xsl-list
[Top] [All Lists]

RE: [xsl] Can I predict the build order of nodes?

2010-02-14 16:55:30

The specification is clear that if two nodes are in different documents,
their relative position in document order is implementation-dependent.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 
 

-----Original Message-----
From: Kevin Brown [mailto:kevin(_at_)renderx(_dot_)com] 
Sent: 14 February 2010 18:51
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Can I predict the build order of nodes?

I noticed an interesting build order/selection issue between 
Saxon and Microsoft XSL transforms ... in my style sheet I have:

<xsl:param name="stylemasterfile">
     <xsl:value-of select="/winelist/stylemasterfile"/>
</xsl:param>

<xsl:param name="stylemasterset" 
select="document($stylemasterfile)/styles | /winelist/styles"/>

<xsl:variable name="stylemaster" select="$stylemasterset[last()]"/>

The XML may have:

1) a file pointer (in /winelist/stylemasterfile) which 
contains <styles>
2) an embedded <styles> (at /winelist/styles)
3) both

If it contains both, the rule should be to select the embedded one. 

But selecting $stylemasterset[last()] and testing I noted 
that they are in opposite order on the two XSLT transformers 
when both exist.

Without saying which is which ... what is the right answer? 
What do you think is the proper result of this:

document($stylemasterfile)/styles | /winelist/styles

Internal styles from /winelist/styles
External styles from document($stylemaster)/styles

or

External styles from document($stylemaster)/styles Internal 
styles from /winelist/styles

Or does the spec make no determination of order?

Kevin Brown
RenderX


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--