[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: new user question Saxon

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.