saxon

Getting The XML Data Inside Custom XPath function

Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an XPathContext but is this enough? Example: Our XML: <foo> <bar>smang</bar> <fizz>buzz</fizz> </foo> Our XSL: <xsl:template match="/"> <xsl:value-of select="ourFunction()" /> </xsl:template> How do w...

Saxon Xalan JSP

I have a JSP which attaches a XSL to an XML document pulled from a database. The application is using the Saxon Parser but my XML needs to use the Xalan one. Can a JSP page override which parser to use? ...

How to get the unparsed entity attribute's value from XSLT?

I have a problem with XSLT and unparsed entity in XML. Here is a fictional scenario. First I got an XML file named doc.xml: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE document [ <!ELEMENT document (employee)*> <!ELEMENT employee (lastname, firstname)> <!ELEMENT lastname (#PCDATA)> <!ELEMENT firstname (#PCDATA)> <!...

How can I change some existing Java XSLT code using Xalan to use Saxon and TinyTree

I have some existing Java code that does an XSLT transform programmatically - originally using Xalan. I have refactored it to be able to use another (externally configured) TransformerFactory. I have tried using the Saxon (v6.5.3 and v8.7) factory, but do not see any perfromance improvements - if anything Saxon is slower and uses more m...

dynamically concatenating xml files with ant and xslt

Question We have a large number of xml configuration files that we want merged into one master version at build time. Smaller config files are easier to maintain and one large file loads faster so I imagined this to be a popular build transformation process that I would find lots of good examples of on the net. I was able to find some...

[MS-Windows] Lauching a Java app from a batch file with the correct JRE

I have a very simple batch file that lauches a Java app (Saxon) with the simple command "java net.sf.Saxon.transform..." This app requires java version 1.5. This batch file will be used by 400+ users who each may or may not have some versions of the JRE installed on their machines. I had thought that simply installing the most recent ...

SAXON.NET XSLT 2.0 Processor

I am using the open source Saxon XSLT processor for .NET to execute some 2.0 transforms. I reference the saxon9api.dll as I would any other dll, and can compile code against this. However Visual Studio does not show any intellisense making the IDE as useful as notepad. The saxon9api.dll is using the IKVM Java for .NET platform, and I w...

Saxon 8 (Java version) problem

I'll point out now, that I'm new to using saxon, and I've tried following the docs and examples in the package, but I'm just not having luck with this problem. Basically, I'm trying to do some xml processing in java using saxon v8. In order to get something working, I took one of the sample files included in the package and modified to...

Saxon XMLBeans Tomcat

We recently updated our Tomcat web service. The only things we really updated were that we updated XMLBeans to version 2.4 and Saxon to version 9. Running it Netbeans and eclipse, our project now works fine, but when trying to deploy to tomcat we get the following. We tried updating JAXEN to version 1.1.1 but no joy. Any ideas? Th...

How to execute XSLT 2.0 with ant ?

I'm trying to run an XSLT transformation from an ant file. I'm using a XSLT 2.0 stylesheet with a saxon 9 parser (supporting XSLT 2.0). The problem is that it seems that ant is always calling an XSLT 1.0 parser. Here's my ant file : <xslt style="stylesheet.xslt" basedir="core/" extension=".xml" destdir="core/" classpa...

Using SAXON Xpath engine in Java

Hi all. Here is my code : public static void main(String[] args) { // System.setProperty( // "javax.xml.xpath.XPathFactory", // "net.sf.saxon.xpath.XPathFactoryImpl"); String xml="<root><a>#BBB#</a><a>#CCC#</a><b><a>#DDD#</a></b></root>"; try{ JDocument dom = new JDocument(xml); XPathFactory factory = net.sf.saxon.xpath.X...

Saxon in ASP.Net website

Hi, I want to use the Saxon-B XQuery class in my ASP.Net website. But my hosting-provider supports only applications in Medium trust level. Does someone know if it's possible to use Saxon-B and IKVM.Net in a medium trust level environment? Or is there a good alternative XQuery engine for a ASP.Net application in a medium trust level e...

XSLT Append to Result Document

Hi, I have an XSLT script that I use for code generation where I process multiple input XML files, and output the files to Javascript code. For each xml input file, I output one Javascript file. So, I would have the following files/transformations occuring: view1.xml -> view1.js view2.xml -> view2.js ... Now I have a requirement ...

Using XSLT to output multiple files

I'm trying to get an example that I found for using XSLT 2.0 to output multiple files working. Using Saxon B 9.7.0.1 with Java 1.6, I get this error: C:\Documents and Settings\Administrator\Desktop\saxon>java -jar saxon9.jar -s:input.xml -xsl:transform.xml Error on line 15 of transform.xml: java.net.URISyntaxException: Illegal charac...

create droplet app. to transform xml with xslt

I want to create a application, where you drop a xml doc on it, and an xslt transformation occurs using saxon as the transform engine. The result is a text file. I am doing this on a mac. Does anyone know where I could find a beginner tutorail to approach this?? Thanks, Ian ...

Handling special characters in XML when transforming with Saxon

I'm attempting to apply a stylesheet to an XML document using Saxon. Given an XML file that was generated in Microsoft Word and that has Microsoft Word-style quotes, such as around FOO in the following document <?xml version="1.0" encoding="UTF-8"?> <doc> <act> <performer typeCode=“FOO“ /> <performer typeCode="BAR" /> ...

XSLT: change namespace in transformer, not in in stylesheet / remove namespace prefix

I am transforming some XML using XSLT and Saxon like this: Source sourceXML = new StreamSource(...); Source sourceXSLT = new StreamSource(...); System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl"); TransformerFactory transFact = TransformerFactory.newInstance(); Templa...

Replacement for saxon:if and saxon:before functions in xslt 2.0

Is there any replacement for saxon:if and saxon:before functions in XSLT 2.0 / XPath 2.0? I have code like this: <xsl:variable name="stop" select="(following-sibling::h:h1|following-sibling::h:h2)[1]" /> <xsl:variable name="between" select="saxon:if($stop, saxon:before(following-sibling::*, $stop), ...

XSLT 2.0 PHP support. When?

What are the chances to see XSLT 2.0 processors like saxon for php in the nearest future? ...

Why would I choose XSLT or XQuery over the other for html document generation?

I was researching alternatives to using Microsoft's XslCompiledTransform and everything seemed to point towards Saxon primarily and secondly XQSharp. As I started to look at documentation for Saxon I saw that XQuery could do the equivalent of my XSLTs that are no where near as terse as XQuery's markup is. What advantages do XSLTs offer ...