[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: new user question Saxon
so if the named template isn't called (incidentally why do you have all those named templates, it makes the code a lot harder to follow than need be, I expect) then this isn't being executed. <xsl:template match="ARTICLE"> Which presumably means that you do not have an element of that name in the source. A common mistake here is for people to forget that the namespace is part of the name, the above matches an element with namespace URI "" and local name ARTICLE and it doesn't match an element <ARTICLE xmlns="foo"> just as it doesn't match an element <XXARTICLE> To match <ARTICLE xmlns="foo"> you'd need to either do <xsl:template match="f:ARTICLE" xmlns:f="foo"> (The xslt1 way) or set the default xpath namespace to foo with xpath-default-namespace="foo" on your xsl:stylesheet. Note that // is an expensive operation, it means search the entire document to arbitrary depth. If you know you only have one BODY element and it's somewhere near the top of the document, don't do this: <xsl:variable name="body" select="//BODY"/> as the system doesn't know that... David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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
|