saxon

Getting NULL pointer exception net.sf.saxon.event.ReceivingContentHandler.startElement in DaisyDiff

早过忘川 提交于 2019-12-25 18:34:11
问题 I'm using DaizyDIff library to compare two html files. I wrote a java code to implement the DaizyDiff. but while running I'm getting NULL pointer exception on net.sf.saxon.event.ReceivingContentHandler.startElement I have tries multiple approach on SAXTransformerFactory , but I couldn't figure out public static void daisyDiffTest() throws Exception { String html1 = "<html><body>var v2</body></html>"; String html2 = "<html> \n <body> \n Hello world \n </body> \n </html>"; try { StringWriter

How can I efficiently run XSLT transformations for a large number of files in parallel?

六月ゝ 毕业季﹏ 提交于 2019-12-25 08:39:44
问题 I have to regularly transform large amount of XML files (min. 100K) within 1 folder each time (basically, from the unzipped input dataset), and I'd like to learn how to do that in the most efficient way as possible. My technological stack consists of XLTs and the Saxon XSLT Java libraries, called from Bash scripts. And it runs on an Ubuntu server with 8 cores and a Raid of SSD with 64Gb of Ram. Keep in mind I handle nicely XSLT but I'm still in the process of learning Bash and how to

Nesting flat XML siblings

心已入冬 提交于 2019-12-25 07:47:59
问题 Attemping to transform XML with XSLT 2.0. Flat Source XML: <body> <R1/> <R1/> <R2/> <R2/> <R2/> <R3/> <R3/> <R3/> <R1/> <R1/> <R2/> <R2/> <R1/> </body> Desired Output: <body> <R1/> <R1> <R2/> <R2/> <R2> <R3/> <R3/> <R3/> </R2> </R1> <R1/> <R1> <R2/> <R2/> </R1> <R1/> </body> Basically these R1 - R3 elements signify sect-1, sect-2, sect-3 type elements. R2's are nested within their previous sibling R1 and R3's are nested within their previous sibling R2. Elements that are the same are on the

Debugger for XQuery that uses Saxon

随声附和 提交于 2019-12-25 04:41:12
问题 Can anyone suggest a debugger for XQuery? I would prefer one that is either online or works within Eclipse, and I prefer something that uses Saxon. So far, all I've found is XQDT (which has little documentation and does not work with Saxon) and a few stand-alone commercial apps. All I want to do is understand why my XQuery isn't selecting the elements I think it should. (My requirement for Saxon is because I've had bad experiences with these processors not meeting the same standard.) Any

Saxon produces empty XML from Schematron

社会主义新天地 提交于 2019-12-25 03:08:37
问题 I am trying to compile Schematron file through the XSLT file (iso_svrl_for_xslt2.xsl) with help of Saxon9HE as described here and there. Here I am calling Saxon with 3 arguments: -o:schema-compiled.xsl is the output file (XSLT script) -s:example_schematron.xsl is the source file iso-schematron-xslt2/iso_svrl_for_xslt2.xsl is the stylesheet file, used to compile schematron file into XSLT script java -jar saxon9he.jar -o:schema-compiled.xsl -s:example_schematron.sch iso-schematron-xslt2/iso

Gradle Kotlin: Could not find net.sf.saxon:saxon-HE:9.9.0-2

穿精又带淫゛_ 提交于 2019-12-25 02:46:11
问题 Saxon doesn't seem to be where gradle is trying to send it: Not Found For request 'GET /artifact/net/sf/saxon/saxon-HE/9.9.0-2/saxon-HE-9.9.0-2.pom' The actual URL is, or looks to be, ../artifact/net.sf.saxon/.. rather than ..artifact/net/saxon.. which causes a problem. How do I tell the kotlin-gradle-dsl , specifically, which repo to look in and how to look in that repo? kotlin build file: // https://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE compile group: 'net.sf.saxon', name: 'Saxon

Writing XSLT output to the multiple objects in memory

北城余情 提交于 2019-12-25 01:04:38
问题 I'm playing with XSLT and writing the result to the multiple outputs in Java as these links describe: link1, link2. When it comes to writing to the files everything works perfectly, but now I'd like to store the output XMLs as either Document object or some kind of InputStream/String - anything but file on a drive. Writing the documents to the files using Transformer and than reading them to the objests (Document, String etc.) is not an option . My question is: what should I change in my xslt

Does the name of the xsl:template effects the result of function fn:key,and why? thanks a lot

橙三吉。 提交于 2019-12-24 19:33:26
问题 I find a appearance , that I can't get a correct result with fn:key function in a template which has a name attribute. When I just delete the name attribute of xsl:template, the result are right. That amazes me. Would somebody like to tell the reason? thanks. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:rel="http:/

how to set xquery context document in java using saxon 9.2he?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 19:23:09
问题 how do I execute a simple this xquery, such as this for $elem in /root/element() return $elem on an xml file using java without using fn:doc? I keep getting XPDY0002: The context item for axis step child::element(xml, xs:anyType) is undefined --the rundown: I need a simple solution to load an xml file, load an xquery and process 回答1: here is the simplest way I found to do it however I was hoping to use XQStaticContext to "bind" the contextDocument to the expression. XQDataSource ds = new

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

谁都会走 提交于 2019-12-24 18:52:16
问题 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), following-sibling::*)" /> Idea is that between variable should contain all elements between current node and next h1 or h2 element (stored in stop variable), or all remaining elements, if there is