|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: match text node
> I have document like:
> <Descr>
> valid html
> </Descr>
> "valid html" - I mean every html (xml-valid) you can imagine with no
> limitation at all. Of course, there are some texts. And there may be
> any nodes inside text and so on.
>
> My task: I need to copy whole document (all nodes and all attributes)
> but in text nodes I need to delete all 
 marks.
You do not need sophisticated string-replacement locic to delete a single
character.
In a template matching any text node and overriding the identity rule use
the translate function like this:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="translate(., '
', '')"/>
</xsl:template>
</xsl:stylesheet>
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








