xsl-list
[Top] [All Lists]

[xsl] Selecting unparsed text from inside a tag

2008-03-25 01:58:53
Hi,
I would like to know if there is a way to select everything that is
inside a tag without parsing it and put it to the output, so that if
there are other tags (like <br/> or <html>) inside our tag then they
will also come up. Here is an example:

xml:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<test>
 TEST<br/><img src="test.jpg" />
</test>

xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >
  <xsl:template match="/test">
    <html>
      <body>
        <xsl:value-of select="."/>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

output that comes out:
<html>
        <body>TEST</body>
</html>

output that I want:
<html>
        <body>TEST<br/><img src="test.jpg" /></body>
</html>

So the difference is that the <br/> and <img> would also come up. As
for now I couldnt find any way for that.
Does somebody know how to do it ?

Thanks for any help,
Thomas

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--