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

nodes order in union

Subject: nodes order in union
From: philippe drix <phdrix@xxxxxxx>
Date: Sat, 17 Nov 2001 19:05:09 +0100
order by union
Hi,
Thanks to David Carlisle, Jeni Tennison, and Michael Kay for their
responses 
to  match + default namespace.


I have now another little problem.
I want to write a recursive copy, following the example of the W3C REC
XSLT1.0 :


    <xsl:template match="child::node()" mode="copie">
		<xsl:copy>
			<xsl:apply-templates select="@*" mode="copie"/>
			<xsl:apply-templates select="node()" mode="copie" />
		</xsl:copy>
		
    </xsl:template>
    
That works fine.

And as expected, the following rule throws a runtime error, because we
try to bind attributes to an element which already owns some children : 
    
    <xsl:template match="child::node() | attribute::*" mode="copie">
		<xsl:copy>
			<xsl:apply-templates select="node()" mode="copie" />
			<xsl:apply-templates select="@*" mode="copie"/>
		</xsl:copy>
		
    </xsl:template> 
    
But if I transform the rule like this :
    
    
    <xsl:template match="child::node() | attribute::*" mode="copie">
		<xsl:copy>
			<xsl:apply-templates select="node()|@*" mode="copie"/>
		</xsl:copy>
		
    </xsl:template>
    
 or like this :
    
    
    <xsl:template match="child::node() | attribute::*" mode="copie">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()" mode="copie"/>
		</xsl:copy>
		
    </xsl:template>
    
no error happens, and the copy is quite correct.

Is the XSLT processor (Saxon, actually) cleaver enougth to process the
nodes in right order ? Or is there somewhere in Xpath or XSLT a rule
which says that in this particulary case, union must yield a node-set
where attributes are located before other nodes (I can't find it)? 

Best regards,
Philippe Drix

 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.