From: Oleg T. <he...@us...> - 2005-10-16 20:13:21
|
Update of /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/tests/GotDotNet/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14178/v2/test/ExsltTest/tests/GotDotNet/Dynamic Added Files: evaluate.xslt source.xml Log Message: --- NEW FILE: evaluate.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dyn2="http://gotdotnet.com/exslt/dynamic" exclude-result-prefixes="dyn2"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="data"> <out> <test1> <xsl:value-of select="dyn2:evaluate(., concat('2', '+', '2'))"/> </test1> <test2> <xsl:copy-of select="dyn2:evaluate(., /data/path)"/> </test2> <test3> <xsl:value-of select="dyn2:evaluate(., /data/path)/@id"/> </test3> <test4> <xsl:copy-of select="dyn2:evaluate(., /data/path2)"/> </test4> <test5> <xsl:value-of select="dyn2:evaluate(/no/such/node, /data/path2)"/> </test5> <test6> <xsl:copy-of select="dyn2:evaluate(., '')"/> </test6> <test7> <xsl:copy-of select="dyn2:evaluate(., /data/path3)"/> </test7> <test8> <xsl:copy-of select="dyn2:evaluate(., 'dyn2:evaluate(., str:concat(path4|path5|path6))')"/> </test8> <test9> <xsl:copy-of select="dyn2:evaluate(., 'orders/order[last()]')"/> </test9> <test10> <xsl:variable name="namespaces">xmlns:foo="http://orders.com" xmlns:bar='http://bar.com/'</xsl:variable> <xsl:copy-of select="dyn2:evaluate(., /data/path7, $namespaces)"/> </test10> <test11> <xsl:copy-of select="dyn2:evaluate(., /data/path7, '')"/> </test11> <test12> <xsl:variable name="namespaces"> xmlns:bar='http://bar.com/" xmlns:foo = "http://orders.com" </xsl:variable> <xsl:copy-of select="dyn2:evaluate(., /data/path7, $namespaces)"/> </test12> <test13> <xsl:copy-of select="dyn2:evaluate(., 'current()')"/> </test13> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: source.xml --- <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="evaluate.xslt"?> <data xmlns:o="http://orders.com"> <orders> <order id="o234">T-Shirt</order> <order id="o12">Polo Shirt</order> <order id="o332">Shoes</order> </orders> <orders xmlns="http://orders.com"> <order id="o11">Foo</order> <order id="o22">Bar</order> <order id="o44">Baz</order> </orders> <path>/data/orders/order[@id='o12']</path> <path2>orders/order[@id='o12']</path2> <path3>o:orders/o:order[@id='o44']</path3> <path4>/data</path4> <path5>/orders/order</path5> <path6>[@id='o332']</path6> <path7>foo:orders/foo:order[@id='o11']</path7> </data> |