saxon

Making multiple files from multiple files with one command in gnu make

回眸只為那壹抹淺笑 提交于 2019-12-22 14:03:02
问题 Assume 1000 files with extension .xhtml are in directory input, and that a certain subset of those files (with output paths in $(FILES), say) need to be transformed via xslt to files with the same name in directory output. A simple make rule would be: $(FILES): output/%.xhtml : input/%.xhtml saxon s:$< o:$@ foo.xslt This works, of course, doing the transform one file at a time. The problem is that I want to use saxon's batch processing to do all the files at one time, since, given the number

How to select an attribute by a variable in xquery?

若如初见. 提交于 2019-12-22 12:26:37
问题 I know how to select an attribute like so: $table/@id However how do I do this if the attribute name is stored as a variable. For example: let $x = "id" $table/@[$x] 回答1: You can use the functions local-name or node-name to capture the value of the attribute and match it the predicate. local-name will simply return a string that matches the element name, and node-name will return a fully qualified name, which is generally recommended, but practically speaking, is only necessary if you are

How do I get EXSLT support in Saxon-HE?

◇◆丶佛笑我妖孽 提交于 2019-12-22 04:42:38
问题 I have a bunch of XSLT files that I need to process against some XML files. I cannot change the XSLT files as they come from a 3rd party. The XSLT's are version 2.0. I'm on Mac OS X 10.6 and it looks like Saxon-HE is the only XSLT 2.0 processor available. Most of the XSLT's work fine, however, some give errors regarding missing functions, specifically month-in-year() and other date/time related functions. According to http://www.saxonica.com/documentation/extensions/exslt.xml regarding EXSLT:

Running custom Java functions within XSLT and SAXON (9.1.8)

人盡茶涼 提交于 2019-12-22 00:24:07
问题 Meta Saxon XSLT processor (v. 9.1.8) Java XSLT 2.0 I got a simple example of a java class file and some xsl transformation. My goal is to run my custom java functions from the class file within the XSLT process (via SAXON). How is this possible? When I start the below described batch file the cmd displays an error calling me the function is not known to saxon. So I have to add my class to the Java / or Saxon CLASSPATH? The transformation should copy all XML data and (return &) display the

Apache Camel Xpath 2.0 with Saxon does not look to work in RouteBuilder / Predicates

南楼画角 提交于 2019-12-21 22:23:22
问题 I am using ServiceMix 4.5.3 which includes Camel 2.10.7 and I am able to make XSLT 2.0 transformations with the Saxon library using the option endpoint like this: ... to("xslt:stylesheet.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl") ... However when I try to use the xpath function like this: private Namespaces ourNS = new Namespaces("myns", "urn:com:company:domain:namespace:myns/1"); // ... some code ... // Make a predicate to filter according a header : // The code

Are there any XSLT to C++ compilers available?

萝らか妹 提交于 2019-12-21 20:27:47
问题 I found only one attempt to create such compiler - http://sourceforge.net/projects/xsltc/. But this project is dead for decade already. Are there any other examples? Opensource or commercial? Are there any fundamental technical difficulties with building such software? With the whole approach of compiling XSLT natively? I suppose there are good use cases for using it - places where we don't need to change XSLT but still would like to get higher performance (and probably, lower memory

How to use the “about:” protocol of HTML5 in XSLT processors

故事扮演 提交于 2019-12-21 05:29:07
问题 The HTML5 draft specifies (at the moment at least), that the URI about:legacy-compat can be used for documents, that rely on an XML conforming doctype (which <!DOCTYPE html> isn't). So I happen to have a bundle of HTML5-validating XML files, that start with: <!DOCTYPE html SYSTEM "about:legacy-compat"> Unfortunately, when I use such an XHTML5 document with any XSLT processor like Xalan or Saxon, they naturally try to resolve the (unresolvable) URI. Is there any way to bring them into ignoring

eXist - loading XSLT collection() - Exception thrown by URIResolver

非 Y 不嫁゛ 提交于 2019-12-20 06:15:54
问题 Environment: eXist-db 4.2.1 , XQuery 3.1, XSLT 2.0 In eXist-db I am loading an XSLT file which includes a reference to a collection in eXist (in order to perform a search on documents found there, using a key). This reference seems to throw an error from Saxon. Exception while transforming node: Exception thrown by URIResolver XML docs are located at /db/apps/deheresi/data/ XSLT docs are located at /db/apps/deheresi/data/styles In the transform function, I am passing a parameter from XQuery

In Saxon 9 he Java XML parser, word boundaries (\b) in regular expressions are not recognized

扶醉桌前 提交于 2019-12-19 05:01:08
问题 I have the following simple regular expression: \b\w+\b Saxon reports the following error: syntax error at char 2 in regular expression: Escape character 'b' not allowed Does it mean I can't use word boundaries with Java Saxon parser? Is there an alternative free XML Java parser that has this functionality? 回答1: The regular expression dialect used in XSD and XPath does not recognize \b (either as a word boundary or as a backspace). I think the reason for excluding it was probably a misplaced

xslt 2.0 tokenize and group

时光怂恿深爱的人放手 提交于 2019-12-18 09:55:38
问题 I have an text file with following data: <t>Heros Firstname Sean Lastname Connery DOB 25-08-1930 Films Dr.No 1962 Goldfinger 1964 Thunerball 1965 Award name Academy time 1 Award name BAFTA time 2 Award name Gloden Globes time 3</t> Expected output should look like: <Jamesfilms> <heros> <firstName>Sean</firstName> <lastName>Connery</lastName> <DOB>25-08-1930</DOB> </heros> <films> <Dr.No>1962</Dr.No> <Goldfinger>1964</Goldfinger> <Thunerball>1965</Thunerball> </films> <award> <name>Academy<