Lawrence Michel, CH
First, the code sample : (not copy-pasted)
< do this.... >
The if condition check for each sorted node, whether it's name attribute might not be found in the following ones.
This part of code works using xmlspy's xslt processor. But I'm unable to have it processed properly using saxon8...
Any help would be greatful
/allNodes selects an allNode element that is the outermost element of the document. There can only be one, so why use for-each?
/following-sibling::* is even stranger: it selects elements that are following siblings of the document (root) node - and of course the root has no siblings.
Let's suppose these "/"s are a typo and weren't really there. Then following-sibling::* refers to the element that immediately follows the allNodes element in the original source tree. Your code looks as if you might be under the impression that it is looking for the node that follows immediately in sorted order. This isn't the case: sorting changes the order in which the nodes are processed, but it doesn't affect the result of following the axes.
Maybe I should copy-paste directly the code :
<xsl:result-document href="procXml.bat" format="bat">
<xsl:text>fop -fo </xsl:text>
<xsl:text>.fo -pdf </xsl:text>
It selects all /Classes/Class/SADefinition nodes where their @SAObjName attribute contains the 'app_' letters. ->ok
Its sorts the result tree according to th @SAObjName attributes ->ok
Because the XML Data contains redundancy SADefinition nodes, I need it to apply the following instructions only once per unique node (and not to its "twins").
Well... I hope the code won't appear too messy ;-)
Well, as I said before, the /following-sibling is clearly wrong.
If you're looking for XSLT programming advice, a better place to go is the xsl-list at www.mulberrytech.com. This forum is intended for Saxon-specific problems.