Re: [xsl] new user question Saxon

Subject: Re: [xsl] new user question Saxon
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 22 Sep 2005 13:16:43 +0100
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...


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:

Current Thread