saxon

how to extract an XPATH from an html page with Saxon-PE commandline

依然范特西╮ 提交于 2020-01-06 08:14:12
问题 I would like to extract the XPATH //DIV[@id="ps-content"] out from this web page: http://www.amazon.com/dp/1449319432 (saved as a local file) I would like to do it with a single line of command-line with one of the best parsers, like Saxon-PE or BaseX. So far the shortest solution that I (seemed to have) found is with these two lines: java -jar tagsoup-1.2.1.jar <page.html >page.xhtml" java -cp saxon9pe.jar net.sf.saxon.Query -s:"page.xhtml" -qs:"//DIV[@id='ps-content']" but all what it

eXist-db / XSLT / Saxon collection() slow as molasses (or errors out with memory limit)

泪湿孤枕 提交于 2020-01-06 05:36:08
问题 Coming from this question, I managed one entirely unsatisfactory solution for accessing an eXist-DB collection() from an XSLT 2.0 document loaded from within an eXist-db/Xquery transformation function: The XSLT file declares a variable : <xsl:variable name="coll" select="collection('xmldb:exist:///db/apps/deheresi/data/collection_ms609.xml')"/> This points to a catalog xml file I created (per Saxon documentation) that looks like this, in order to load the actual collection: <collection stable

Error when running XSLT with eclipse

北城以北 提交于 2020-01-06 01:36:36
问题 When I use eclipse xsl development tools to run xsl transformation, it reports the following error. But using saxon there is no problem. SIt would be appreciated if some expert can provide possible solution. 12:44:14,714 INFO [main] Main - javax.xml.transform.TransformerFactory=null 12:44:14,725 INFO [main] Main - java.endorsed.dirs=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/endorsed 12:44:14,744 INFO [main] Main - launchFile: /gpfs/work01/work/scratch/users/feifan_liu/.metadata/

Insert element into XML using XQuery and Java

馋奶兔 提交于 2020-01-05 10:40:06
问题 I need to insert a new element into an XML document using XQuery insert expression. I am using saxon as a java api. I am new to XQuery so I am not sure about the exact structure of the insert expression. Can anyone help me in this please. My XML file looks like the following: <?xml version="1.0" encoding="ISO-8859-1"?> <breakfast_menu> <food> <name>Belgian Waffles</name> <price>$5.95</price> <description>two of our famous Belgian Waffles with plenty of real maple syrup<description> <calories

Insert element into XML using XQuery and Java

蹲街弑〆低调 提交于 2020-01-05 10:39:23
问题 I need to insert a new element into an XML document using XQuery insert expression. I am using saxon as a java api. I am new to XQuery so I am not sure about the exact structure of the insert expression. Can anyone help me in this please. My XML file looks like the following: <?xml version="1.0" encoding="ISO-8859-1"?> <breakfast_menu> <food> <name>Belgian Waffles</name> <price>$5.95</price> <description>two of our famous Belgian Waffles with plenty of real maple syrup<description> <calories

How to use the XQuery fn:idref() function?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 07:26:15
问题 I can't get the XQuery function fn:idref() to return anything. I have this XML document doc.xml ; <doc> <foo idref="xyz"/> <bar xml:id="xyz"/> </doc> And this XQuery; let $d := doc("doc.xml") return $d/idref("xyz") But the result is always empty. I'm guessing that the attribute idref="xyz" needs to be declared as type idref but can that be done without a schema? I'm using Saxon XQuery 1.0 processor. 回答1: Yes, the idref() function only retrieves attributes labelled as being IDREFs, and that

XSLT 2.0 PHP support. When?

浪子不回头ぞ 提交于 2020-01-03 09:03:15
问题 What are the chances to see XSLT 2.0 processors like saxon for php in the nearest future? 回答1: In the nearest future? None. PHP5 relies exclusively on LibXSLT for XSLT processing (Sablotron is out), and there is no plan to support XSLT 2.0 in this library. 回答2: This isn't entirely true. If you are running PHP on the Windows platform, then there is a relatively easy to configure extension to the AltovaXML XSLT 2.0 processor... http://sourceforge.net/projects/xslt2processor/ If you are running

XSLT 2.0 PHP support. When?

左心房为你撑大大i 提交于 2020-01-03 09:03:04
问题 What are the chances to see XSLT 2.0 processors like saxon for php in the nearest future? 回答1: In the nearest future? None. PHP5 relies exclusively on LibXSLT for XSLT processing (Sablotron is out), and there is no plan to support XSLT 2.0 in this library. 回答2: This isn't entirely true. If you are running PHP on the Windows platform, then there is a relatively easy to configure extension to the AltovaXML XSLT 2.0 processor... http://sourceforge.net/projects/xslt2processor/ If you are running

XSLT function returns different results [Saxon-EE vs Saxon-HE/PE]

橙三吉。 提交于 2020-01-03 08:15:14
问题 I am currently working on a pure XSL-Transformation with Saxon-Processor in various versions. Below is my short stylesheet, simplified for the needs of my question: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:foo="bar"> <xsl:output encoding="UTF-8" method="text"/> <xsl:template match="/"> <xsl:text>Call of func_1: </xsl:text> <xsl:value-of select="foo:func_1()"/> <xsl

XSLT function returns different results [Saxon-EE vs Saxon-HE/PE]

六月ゝ 毕业季﹏ 提交于 2020-01-03 08:14:05
问题 I am currently working on a pure XSL-Transformation with Saxon-Processor in various versions. Below is my short stylesheet, simplified for the needs of my question: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:foo="bar"> <xsl:output encoding="UTF-8" method="text"/> <xsl:template match="/"> <xsl:text>Call of func_1: </xsl:text> <xsl:value-of select="foo:func_1()"/> <xsl