[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Xalan to transform only selected elements of XML
> I want to remove a few elements. In other words, I want only some of the > elements of XML to get transformmed. It seems that > even *with* and *without* following lines in .XSL file > <xsl:template match="/"> > <xsl:apply-templates/> > </xsl:template> > the value of all the elements are getting transformeed This isn't Xalan-specific, and as such is on-topic :) http://www.w3.org/TR/xslt#built-in-rule reveals that there is a built-in template for the root node that does exactly what you wrote, so that's why it doesn't matter if you put it in or not. http://www.w3.org/TR/xslt#section-Applying-Template-Rules explains "In the absence of a select attribute, the xsl:apply-templates instruction processes all of the children of the current node, including text nodes." If you want only certain children to be processed, use the select="foo" attribute, where foo is an XPath expression identifying the nodes, relative to the current one, that you want to process. - Mike ____________________________________________________________________ Mike J. Brown, software engineer at My XML/XSL resources: webb.net in Denver, Colorado, USA http://www.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
|