|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Apply-templates for getting around my XML doc?
Hi Edmund,
At 10:33 AM 10/11/00 -0400, you wrote: OK. If I wanted to process specific elements only, and no others, in the order listed in the stylesheet, ...Leaving aside that your element names couldn't actually be '0', '1', but would have to be 'A0' 'A1' etc. -- element names can't start with numerals ... /L/8/iii would only match if your document element were L ... which it can't be, since you stipulate it's a sibling of M, X etc. (and well-formed documents can only have one document element). This is because the XPath location path starting with / navigates down from the root, which is above the document element. So I'm surprised that these templates are matching at all. Hopefully this can eliminate [this style of navigating] as a potential error. I don't understand how the processor thinks, and I had some problems with templates being ignored, but a wise man recommended this style as a [simple-enough-for-even-me-to-understand] potential solution. Have I missed even that boat? Well, it's not that bad. It's really a case of fathoming the subtleties of XPath. Try it again with examples like <xsl:template match="X/8/iii"> <xsl:apply-templates select="//L/4/ii"/> </xsl:template> and such like (note the positions of the slashes). Performance on this will be poor (that select expression is going to traverse the entire document looking for nodes), but it should work. There are undoubtedly other ways to approach this problem, but my head is hurting after a day of teaching.... Good luck, Wendell
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








