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

Re: Confused with templates and XPath

Subject: Re: Confused with templates and XPath
From: Frédéric Laurent <fl@xxxxxxxxxxxxx>
Date: Thu, 8 Jan 2004 14:07:28 +0100
namespace wildcard

David Carlisle wrote:
>>are you sure of that ?
> 
> yes:-)

I had no doubt on that :D

> 
> 
> If I run saxon on the example document that you posted, I get:

well neither Xalan nor xsltproc complains :(
Same results for both... (even with the permutation)

> $ saxon prio.xml prio.xsl
> Recoverable error
> Ambiguous rule match for /doc[1]/chapter[1]/para[1]
...

> the rules are _very_ simple.
> 
> If it is a sigle name, such as "para" then it is priority 0
> if it is a child or attribute axis followed by a single name
> child::para, attribute::para, @para it would also be 0
> 
> If its a namespace wildcard such as x:* it's -0.25
> 
> If its a node test such as comment() it's 0.25
> 
> otherwise it is 0.5
> 
> so:
> 
> //para has priority 0.5
> chapter/para has priority 0.5
> para has priority 0

If you set the verbose mode to xsltproc, you have

$ xsltproc -v s05b.xsl xml05.xml
Added namespace: xsl mapped to http://www.w3.org/1999/XSL/Transform
xsltPrecomputeStylesheet: removing ignorable blank node
xsltParseStylesheetProcess : found stylesheet
xsltCompilePattern : parsing '//para'
xsltCompilePattern : parsed //para, default priority 0.000000
added pattern : '//para' priority 0.000000
xsltCompilePattern : parsing 'chapter/para'
xsltCompilePattern : parsed chapter/para, default priority 0.500000
added pattern : 'chapter/para' priority 0.500000
parsed 2 templates



added pattern : '//para' priority 0.000000
added pattern : 'chapter/para' priority 0.500000

hummm... Then this is a bug ?

cheers

Fred

-- 

XPath free testing software :  http://lantern.sourceforge.net
Frédéric Laurent                     http://www.opikanoba.org

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.