xsl:copy-of question

Discussion in 'XML' started by David Shen, Sep 6, 2003.

  1. David Shen

    David Shen Guest

    I would like to copy the entire tree. However, it only copy the text.

    The xml file is the following:
    <?xml version="1.0"?>
    <hello>
    Hello there, world!
    <AAA>valueA</AAA>
    </hello>

    The xsl file is the following:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:eek:utput encoding="UTF-16" method="xml" indent="yes"/>
    <xsl:template match="/">
    <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:stylesheet>

    The result is
    Hello there, world! valueA

    I would like to get
    <hello>
    Hello there, world!
    <AAA>valueA</AAA>
    </hello>

    Thanks

    David
     
    David Shen, Sep 6, 2003
    #1
    1. Advertising

  2. Most probably you are viewing the result with a browser.

    When viewed with a normal text editor the result is an exact copy of the
    source xml document.


    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL


    "David Shen" <> wrote in message
    news:...
    > I would like to copy the entire tree. However, it only copy the text.
    >
    > The xml file is the following:
    > <?xml version="1.0"?>
    > <hello>
    > Hello there, world!
    > <AAA>valueA</AAA>
    > </hello>
    >
    > The xsl file is the following:
    > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    version="1.0">
    > <xsl:eek:utput encoding="UTF-16" method="xml" indent="yes"/>
    > <xsl:template match="/">
    > <xsl:copy-of select="."/>
    > </xsl:template>
    > </xsl:stylesheet>
    >
    > The result is
    > Hello there, world! valueA
    >
    > I would like to get
    > <hello>
    > Hello there, world!
    > <AAA>valueA</AAA>
    > </hello>
    >
    > Thanks
    >
    > David
     
    Dimitre Novatchev, Sep 6, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,057
    Kevin Flood
    Sep 8, 2004
  2. Vijay singh
    Replies:
    1
    Views:
    455
    Martin Honnen
    Nov 4, 2004
  3. Replies:
    1
    Views:
    3,695
    A. Bolmarcich
    May 27, 2005
  4. Alex
    Replies:
    2
    Views:
    1,294
  5. Replies:
    26
    Views:
    2,184
    Roland Pibinger
    Sep 1, 2006
Loading...

Share This Page