xslt-3.0

Saxon Prematurely Evalutes xsl:attribute-set

送分小仙女□ 提交于 2019-12-10 10:52:38
问题 This relates to schema-aware validation of inputs into an XSLT transformation using latest Saxon EE 9.8. My XSLT file contains the following. A namespace and associated schema defined as such: <xsl:import-schema namespace="http://www.fpml.org/2005/FpML-4-2" schema-location="/path/to/some_swbml.xsd"/> A result document conforming to the above schema: <xsl:result-document method="xml" href="{$file}" format="swbml-format" validation="strict"> <SWBML xmlns="http://www.fpml.org/2005/FpML-4-2" xsl

XSLT Streaming Chained Transform

不打扰是莪最后的温柔 提交于 2019-12-08 03:15:23
问题 I am using Saxon EE to transform a very large document, using streaming transform. I now need to chain multiple XSLTs. How does one go about doing that ? When not streaming, I have used the XSLTTransformer class as destination, to do chained transforms. If I am not mistaken, I guess I cannot do that, as that would create a result tree as against result stream. Thanks, Ani 回答1: Pipe the SAX output events of the 1st transform into the SAX input events of the 2nd transform. I've attached some

How to use XSLT 3.0 from a Java application?

被刻印的时光 ゝ 提交于 2019-12-07 15:22:38
问题 The general java code i use to process XSLT and XML files are : public static final String transformXmlDocument(String inputXmlString, File xsltFile) { TransformerFactory factory = TransformerFactory.newInstance(); StreamSource xslt = new StreamSource(xsltFile); StreamSource text = new StreamSource(new StringReader(inputXmlString)); StringWriter writer = new StringWriter(); StreamResult textOP = new StreamResult(writer); try { Transformer transformer = factory.newTransformer(xslt);

How to use XSLT 3.0 from a Java application?

廉价感情. 提交于 2019-12-05 22:03:12
The general java code i use to process XSLT and XML files are : public static final String transformXmlDocument(String inputXmlString, File xsltFile) { TransformerFactory factory = TransformerFactory.newInstance(); StreamSource xslt = new StreamSource(xsltFile); StreamSource text = new StreamSource(new StringReader(inputXmlString)); StringWriter writer = new StringWriter(); StreamResult textOP = new StreamResult(writer); try { Transformer transformer = factory.newTransformer(xslt); transformer.transform(text, textOP); } catch (TransformerConfigurationException e) { e.printStackTrace(); } catch

How to normalize XML on reverse domain name sorting and custom filtering

你。 提交于 2019-12-04 05:45:24
问题 I've been working on a Geo application. Over the time the product's XML has grown bit messy. The problem arises when synchronizing the changes across multiple environments, like Dev, Test, etc. I'm trying to figure out a way to normalize the content, so I can avoid some cumbersome while editing and merging, and hence, have a productive development. I know it sounds crazy, and there's lot on the background, but let me jump to the actual issue leaving the history. Here's the issue: Multiple

XML to JSON Transformation in XSLT 3.0 [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-02 14:08:57
I am trying to convert XML data to JSON in XSLT 3.0 using xml-to-json function. Can any one please provide me the Xslt 3.0 for the below requirement. Example XML is: <widget> <debug>on</debug> <window title="Sample Konfabulator Widget"> <name>main_window</name> <width>500</width> <height>500</height> </window> <image src="Images/Sun.png" name="sun1"> <hOffset>250</hOffset> <vOffset>250</vOffset> <alignment>center</alignment> </image> <text data="Click Here" size="36" style="bold"> <name>text1</name> <hOffset>250</hOffset> <vOffset>100</vOffset> <alignment>center</alignment> <onMouseUp> sun1

append data ton an element, based on matching this exact element

孤街醉人 提交于 2019-12-02 07:17:58
Given the following XML as input, <?xml version="1.0" encoding="UTF-8"?> <TABLE NAME="TABLE.DB"> <DATA RECORDS="2"> <RECORD ID="4"> <RECNO>0</RECNO> <SEQ>0</SEQ> <DATE>17/12/1999 2:44:08 μμ</DATE> <ID>12/11/2015 3:15:25 μμ</ID> <NUMBER>10354</NUMBER> <CN>PL</CN> <PROPERTY>0</PROPERTY> <DAYS>0</DAYS> <CURRENTSTATUS>0</CURRENTSTATUS> <TOTALS>1</TOTALS> </RECORD> <RECORD ID="3"> <RECNO>1</RECNO> <SEQ>0</SEQ> <DATE>17/12/1999 2:44:08 μμ</DATE> <ID>12/11/2015 3:15:25 μμ</ID> <NUMBER>10355</NUMBER> <CN>PL</CN> <PROPERTY>0</PROPERTY> <DAYS>0</DAYS> <CURRENTSTATUS>0</CURRENTSTATUS> <TOTALS>1</TOTALS>

xslt 3.0 json-to-xml and xml-to-json conversion

自古美人都是妖i 提交于 2019-11-30 16:25:49
Currently I need to convert json to xml and xml to json vice versa using XSLT 3.0 & Saxon-HE. Below is my json abc.xml file <?xml version="1.0" encoding="UTF-8" ?> <root> <data>{ "cars" : [ {"doors" : "4","price" : "6L"}, {"doors" : "5","price" : "13L"} ] } </data> </root> Below is xsl file xyz.xsl <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:math="http://www.w3.org/2005/xpath-functions/math" exclude-result-prefixes="xs math" version="3.0"> <xsl:output indent="yes"/> <xsl:template match="data"> <xsl:copy-of select="json-to