[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: cdata()
Hélder Sousa wrote: > I have an old xsl file that use the namespace <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> > In this xsl is used the following code: > > <xsl:for-each select="cdata()"> > <xsl:eval no-entities="1">this.nodeTypedValue</xsl:eval> > </xsl:for-each> > > This code select all CDATA sections, using "cdata()", and write the value of each CDATA section. (this works fine!) > But using the namespace above I can't use "<xsl:call-template name="xpto"> > So I use the namespace <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> but this don't recognize the "cdata()" function! > Anyone can help me? CDATA sections are not part of the XPath 1.0 data model. All adjacent character data in an element, whether PCDATA or CDATA, becomes one text node. You can select or match on a text node with text(). However I think you can replace the entire for-each with <xsl:value-of select="."/> or <xsl:value-of seelct="text()"/> Mike -- Mike J. Brown | http://skew.org/~mike/resume/ Denver, CO, USA | http://skew.org/xml/ 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
|