xslt-3.0

dynamic xml generation using XSLT

∥☆過路亽.° 提交于 2019-12-13 02:48:10
问题 We have incoming JSON data from Source which has data and column in same payload. Using json-to-xml in XSLT I was able to generate XML like following: <?xml version="1.0" encoding="UTF-8"?> <map xmlns="http://www.w3.org/2005/xpath-functions"> <boolean key="allData">true</boolean> <map key="factMap"> <map key="T!T"> <array key="rows"> <map> <array key="dataCells"> <map> <string key="label">1A</string> <string key="value">1A</string> </map> <map> <string key="label">1B</string> <string key=

XML - XSLT - Using two XML files - Additions to XML file consulting another XML file

最后都变了- 提交于 2019-12-13 00:22:48
问题 I have the following problem that, for me, is kind of tricky, Basically I need to be able to modify a XML input file with data that I have stored in another XML file, so I would have to use 2 input XML files, I have the following XML file, which is the one I want to modify (basically, just make additions to it): <?xml version="1.0" encoding="UTF-8"?> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1"> <text-prop name="displayName">PersonTemplate</text-prop> <setup

add an element to a node, if it doesnot exist

霸气de小男生 提交于 2019-12-12 18:07:59
问题 Using xslt-3, i try to insert the element PROPERTY, if it does not already exist to each RECORD node: <?xml ="1.0" encoding="UTF-8"?> <TABLE NAME="TABLE.DB"> <DATA RECORDS="2"> <RECORD ID="1"> <RECNO>1</RECNO> <SEQ>0</SEQ> <DATE>17/12/1999 2:44:08 μμ</DATE> <ID>12/11/2015 3:15:25 μμ</ID> <ORDER>10355</ORDER> <CN>PL</CN> </RECORD> <RECORD ID="2"> <RECNO>2</RECNO> <SEQUENCE>0</SEQUENCE> <DATE>17/12/1999 2:44:08 μμ</DATE> <ID>12/11/2015 3:15:25 μμ</ID> <ORDER>10356</ORDER> <CN>PL 300 L</CN> <

JSON serialization with XPath 3.1 fn:serialize

◇◆丶佛笑我妖孽 提交于 2019-12-12 11:35:41
问题 I am using XSLT 3.0 in Saxon-HE 9.8 and would like to work with JSON documents as linked data in JSON-LD. In JSON-LD, full HTTP URIs often appear as values. When I use the XPath 3.1 fn:serialize to round-trip the data back to JSON, the solidus characters in http:// are escaped. Is it possible to avoid this escaping when serializing back to JSON? The fn:parse-json function has an escape parameter that can be set to true() or false() , but I don't see anything similar for fn:serialize . I can

XSL getting value of immediately preceding element/@attribute

我的未来我决定 提交于 2019-12-11 11:49:06
问题 I have an XML text file, divided into <deposition> s, each marked up with <footnote> and <appnote> containing identifying numbers and letters for footnote purposes. Now I want to cycle through those (XSL 3.0/Saxon) and then get an attribute of the element immediately preceding it to populate a new footnote 'block' called <footnotes> at the end of each <deposition> . Test can be found here http://xsltfiddle.liberty-development.net/948Fn5a/16 XML: <?xml version="1.0" encoding="UTF-8"?> <corpus>

JSON to XML transformation in XSLT 3.0

只谈情不闲聊 提交于 2019-12-11 06:47:07
问题 I am trying to convert JSON data to XML in XSLT 3.0 using json-to-xml function,but the produced xml is not as expected for example Input JSON: { "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML

Sorting words according to letters of an old Semitic language

纵然是瞬间 提交于 2019-12-11 02:19:32
问题 I use XSLT 3.0, Saxon-PE 9.7. I need to sort orth according to the Ugaritic language, close to Hebrew but with additional characters. I have tried: <xsl:sort select="orth" data-type="text" order="ascending" lang="uga"/> But the proposed order is not correct. So I think I need to describe the Ugaritic alphabetic order. How can I do? In advance, thank you very much. 回答1: Saxon allows you to define your own collation in its configuration file, you basically have to set up a configuration file

XSLT: How to parse HTML embedded in XML tags

自闭症网瘾萝莉.ら 提交于 2019-12-10 23:57:48
问题 I came across situation where XML tag has HTML code that needs to be parsed in XSLT. Here is the XML sample: <note> <text><p>This is a paragraph.</p><p>This is another paragraph.</p></text> </note> I want the embedded paragraph elements to be stored in different variables. This is a paragraph. should be stored in one variable and This is another paragraph. should be stored in another variable. Can you please help? 回答1: Parsing XML documents with parse-xml https://www.w3.org/TR/xpath-functions

XSLT 3.0 Streaming with Grouping and Sum/Accumulator

≯℡__Kan透↙ 提交于 2019-12-10 21:16:11
问题 I'm trying to figure out how to use XSLT Streaming (to reduce memory usage) in a scenario that requires grouping (with an arbitrary number of groups) and summing the group. So far I haven't been able to find any examples. Here's an example XML <?xml version='1.0' encoding='UTF-8'?> <Data> <Entry> <Genre>Fantasy</Genre> <Condition>New</Condition> <Format>Hardback</Format> <Title>Birds</Title> <Count>3</Count> </Entry> <Entry> <Genre>Fantasy</Genre> <Condition>New</Condition> <Format>Hardback<

XSLT 3.0 streaming (Saxon)

二次信任 提交于 2019-12-10 13:47:47
问题 I have a big XML file (6 GB) with this kind of tree: <Report> <Document> <documentType>E</documentType> <person> <firstname>John</firstname> <lastname>Smith</lastname> </person> </Document> <Document> [...] </Document> <Document> [...] </Document> [...] </Report> If I apply an XSLT style sheet on it, I have this error: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space So I wanted to try the new XSLT 3.0 feature: streaming, with Saxon 9.6 EE. I don't want to have the