I am trying to transform xml to html. With oxygen the Xpath such as follows:
<a href="#cite{count(preceding::citation) + 1}">
<xsl:value-of select="count(preceding::citation) + 1"/>
</a>
Basically the purpose of this is to insert a numbered reference link, based on count of references preceeding.
This works when transformed in oxygen.
When run from command line, 1
is the output for all links.
command line commands Ive attempted look like this:
java -jar /usr/share/java/saxon9he.jar -s:report1.xml -xsl:test.xsl -o:output4.html -t
I have also tried saxon9ee:
java -cp /usr/share/java/saxon9ee.jar com.saxonica.Transform -s:report1.xml -xsl:test.xsl -o:output3.html -t
Any help is appreciated!
test.xsl can be found here
http://pastebin.com/6qZeEgD8
report1.xml
http://pastebin.com/5SMY8c7W
contentconfig.xml
http://pastebin.com/A2etm4Cr
Here is the -t
output:
Saxon-HE 9.7.0.4J from Saxonica
Java version 1.7.0_79
Stylesheet compilation time: 1.59928s (1599.280903ms)
Processing file:/root /CRIReportProject/cpreport.xml
Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Building tree for file:/root/CRIReportProject/cpreport.xml using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 1.296529ms
Tree size: 27 nodes, 54 characters, 5 attributes
URIResolver.resolve href="contentconfig.xml" base="file:/root/CRIReportProject/cptest.xsl"
Building tree for file:/root/CRIReportProject/contentconfig.xml using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 3.144498ms
Tree size: 28 nodes, 161 characters, 6 attributes
Execution time: 131.347609ms
Memory used: 8428592
citation
element might belong to? - Flynn1179-t
show? - Martin Honnenxsl:number
instruction. Difficult to say for sure, but it might be helpful as an alternative to counting preceding nodes, which isn't particularly efficient for large documents. - Flynn1179