saxon


XSLT: CSV (or Flat File, or Plain Text) to XML

痴心易碎 提交于 2020-01-13 19:00:48
问题 I am trying to convert plain text files to XML files using XSLT. I started with CSV files, because that is a well-known file format that I could start Googling examples on. I stumbled onto this: http://ajwelch.blogspot.com/2007/02/csv-to-xml-converter-in-xslt-20.html, which also points at http://andrewjwelch.com/code/xslt/csv/csv-to-xml_v2.html. Those links contain what is, supposedly, an XSLT (2.0) that can take a CSV file and convert it to an XML file. ...Except it doesn't actually work. I

How to use saxon built-in catalog feature

别来无恙 提交于 2020-01-11 10:35:29
问题 I downloaded SaxonHE9-4-0-6J and want to process XHTML on CLI. However Saxon tries to load DTD from W3C and it takes too much time for every simple command. I have xml catalog, which I use successfully with xmllint by set env variable pointing to catalog file, but I have no idea how to make Saxon use it. Google reveals whole history of changes (thus confusion) in regards of using catalogs with Saxon, and none made me happy. I downloaded resolver.jar and set it in my CLASSPATH, but I can't

Pass xml document as parameter to xsl

余生颓废 提交于 2020-01-11 09:53:50
问题 I have read a lot of post and tried a lot of things but still can't get the xsl to find values in the parameter. I started with java's sun xalan and never got it working so I switched to saxon to no avail. I want to combine two xml docs into one with xls. Never are on a file system, this is for a web app that builds xml strings/ docs. I have tried passing an DTMAxisIterator, DomSource , Doc to Node set in xsl, string. It worked fine in NotePad++ with an xsl document() but I don't want to save

XSLT change/override attribute on copy-of not applied (using saxon )

杀马特。学长 韩版系。学妹 提交于 2020-01-06 12:26:10
问题 I have a xslt like this: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:db="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" /> <xsl:template match="/"> <xsl:for-each select="db:databaseChangeLog/db:changeSet"> <xsl:if test="name(*[1])='createTable'"> <xsl:result-document href="base/tables/{position()}_{name(*[1])}_{*[1]/@tableName}.xml"> <databaseChangeLog xmlns="http://www

Saxon XSLT-Transformation: How to change serialization of an empty tag from <x/> to <x></x>?

混江龙づ霸主 提交于 2020-01-06 08:16:31
问题 I do some XSLT-Transformation using Saxon HE 9.2 with the output later being unmarshalled by Castor 1.3.1 . The whole thing runs with Java at the JDK 6 . My XSLT-Transformation looks like this: <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://my/own/custom/namespace/for/the/target/document"> <xsl:output method="xml" encoding="UTF-8" indent="no" /> <xsl:template match="/"> <ns:item> <ns:property name="id"> <xsl:value-of select="/some/complicated

Saxon XSLT-Transformation: How to change serialization of an empty tag from <x/> to <x></x>?

随声附和 提交于 2020-01-06 08:16:12
问题 I do some XSLT-Transformation using Saxon HE 9.2 with the output later being unmarshalled by Castor 1.3.1 . The whole thing runs with Java at the JDK 6 . My XSLT-Transformation looks like this: <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://my/own/custom/namespace/for/the/target/document"> <xsl:output method="xml" encoding="UTF-8" indent="no" /> <xsl:template match="/"> <ns:item> <ns:property name="id"> <xsl:value-of select="/some/complicated

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

随声附和 提交于 2020-01-06 08:14:33
问题 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

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/

工具导航Map