[xslt] exslt node-set



I have been trying to learn how to use this seemingly useful
function exslt:node-set, hoping to see if i could overlay the node sets
somehow, the results have been slightly bizaar, so i thought
i would post the stylesheet and the output, both for xsltproc
and java saxon - i am wondering perhaps if what i am trying
to do is not what the | operator in XPath is for, either
way the output is different for xsltproc and saxon

- btw, this is a lot of fun, thanks for the tools!
dd

running saxon parser
=====================
# alias jxslt='/jdk1.3/bin/java -cp ~/ddupas/xml/sax 
com.icl.saxon.StyleSheet  '

# jxslt any.xml test.xsl
<?xml version="1.0" encoding="utf-8"?><elem_c 
xmlns:exslt="http://exslt.org/common">ORIG_TEXT</elem_c>
<elem_c xmlns:exslt="http://exslt.org/common">OVERRIDE_TEXT</elem_c>

running xsltproc
=================
                    "@>
                 "@Ð
                                                      &quot;@_TEXT</text></Ð

# xsltproc  test.xsl any.xml
xmlEncodeEntitiesReentrant : in"@><text>&#136;
<?xml version="1.0"?>       "@Ð
<elem_c>ORIG_TEXT</elem_c><Ð


=== a bit hard to explain, error is xmlEncodeEntitiesReentrant is unhappy

test.xsl
=========


<?xml version= "1.0"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:exslt="http://exslt.org/common"
    >

<xsl:variable  name="base" >
<root > <elem_a>
<elem_b>i am here </elem_b>
</elem_a>
<elem_c>ORIG_TEXT</elem_c>
<elem_d/>
</root>
</xsl:variable>

<xsl:variable  name="merge" >
<root> <elem_a>
<mer_a>TXT</mer_a>
</elem_a>
<elem_c>OVERRIDE_TEXT</elem_c>
</root>
</xsl:variable>

<xsl:template match="text()" />

<xsl:template match="/">
         <xsl:copy-of
                 select="exslt:node-set( exslt:node-set($base)//elem_c | 
exslt:node-set($merge)//elem_c) " />

         </xsl:template>

</xsl:stylesheet>

===version info ===

root@c55289-001:~/ddupas/xml/exslt/exsl/functions/node-set# xslt-config 
--version
1.0.4
root@c55289-001:~/ddupas/xml/exslt/exsl/functions/node-set# xml2-config 
--version
2.4.5





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]