xslt-3.0

XSLT3 joining values with separator

大憨熊 提交于 2020-06-17 13:23:07
问题 I'm pretty new to XSLT and I've been struggling to replicate the solution mentioned here XSL for-each: how to detect last node? for longer than I'm willing to admit :( I've setup this fiddle. https://xsltfiddle.liberty-development.net/naZXVFi I was hoping I could use just the value-of + separator, vs choose / when xslt tools, as it did seem more idiomatic. I can't get the separator to show up; nor can I select just the child of skill, I always get the descendants too. That's to say, I shouldn

Extract value from one XML while matching template in other XML using XSLT

Deadly 提交于 2020-06-17 13:22:08
问题 I have 2 XMLs. I am trying to run XSLT on 1st XML and matching data in 2nd XML using keys. While doing template-match on 2nd XML,I am unable to pull data from 1st XML's matching node(dont know how to pull any data from there per say) and populate it in there. Below are samples and expected output. 1st XML- <parent> <child> <name>John</name> <city>Boston</city> <shortCityCode>B</shortCityCode> </child> <child> <name>John</name> <city>Seattle</city> <shortCityCode>S</shortCityCode> </child>

JSON to XML conversing USING XSLT 3.0

人盡茶涼 提交于 2020-04-17 21:54:17
问题 I have using Windows and SAXON 9.9(HE) . My JSON Code is: {"analystId": "Test","jobId": "","profileData":{"allAuthorCoverage": false,"abc":"xyz","assetClasses":[{"status": "Test1"}]}} MY XSLT Code is: <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" /> <xsl:strip-space elements="*"/> <xsl:param name="input" select="'simple3.json'"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl

JSON to XML conversing USING XSLT 3.0

亡梦爱人 提交于 2020-04-17 21:51:08
问题 I have using Windows and SAXON 9.9(HE) . My JSON Code is: {"analystId": "Test","jobId": "","profileData":{"allAuthorCoverage": false,"abc":"xyz","assetClasses":[{"status": "Test1"}]}} MY XSLT Code is: <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" /> <xsl:strip-space elements="*"/> <xsl:param name="input" select="'simple3.json'"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl

Count the lines after grouping data in XSLT

回眸只為那壹抹淺笑 提交于 2020-02-07 02:35:25
问题 I need to get the number of rows in the output after the data have been grouped. XML input file looks like this: <?xml version='1.0' encoding='UTF-8'?> <root> <entry> <ID>T-1149</ID> <Item_ID>FM1</Item_ID> <Item_Amount> <Amount>20.00</Amount> </Item_Amount> </entry> <entry> <ID>T-1149</ID> <Item_ID>FM1</Item_ID> <Item_Amount> <Amount>10.00</Amount> </Item_Amount> </entry> <entry> <ID>T-1142</ID> <Item_ID>FM1</Item_ID> <Item_Amount> <Amount>10.00</Amount> </Item_Amount> </entry> <entry> <ID>T

How to access previous and next item based on a condition

╄→尐↘猪︶ㄣ 提交于 2020-01-25 08:34:06
问题 I have 2000 TEI-XML-files with letters between different people and a single person in a single folder. I can access the previous and next letter chronologically as the filename starts with the date of the sender (e.g. 2001-02-21.xml). But what I want to achieve is to create an XSLT (2 or 3, doesn't matter) that writes the next letter to or from the specific writer/receiver into the xml-file. Say I have this: <correspDesc> <correspAction type="sent"> <persName key="CMvW">Carl Maria von Weber<

How to add a delimiter between each element in a for-each loop?

扶醉桌前 提交于 2020-01-25 02:49:05
问题 I am looping through each element in a list and outputting a certain value: <xsl:for-each select="properties/property"> <xsl:value-of select="name"/> </xsl:for-each> This simply outputs a concatenation of the name node of property. I want to add delimiter, such as ; between each element. How can this be done? I listed XSLT versions 1.0, 2.0 and 3.0 as functionalities might differ between different versions. 回答1: If you are using XSLT 2.0 or above, you can drop the xsl:for-each and just do it

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

吃可爱长大的小学妹 提交于 2020-01-21 03:49:26
问题 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

how to remove headers and produce no output when specific condition is not met

旧街凉风 提交于 2020-01-16 19:31:10
问题 I have XML data which I have transformed using XSLT from XML to output csv formatted text. It generates the output when the filter condition is met. I now need the code to stop producing any output when filter condition not met. Currently it generates header when the filter condition is not met. I tried setting global variable but getting an error. <xsl:output method="text" omit-xml-declaration="yes" indent="no"/> <xsl:strip-space elements="*"/> <xsl:variable name="delimiter" select="','"/>

XML - XSLT - Using two XML input documents

陌路散爱 提交于 2019-12-25 00:24:30
问题 I have a little problem that probably is very easy to solve but I've been with it all afternoon and I really don't know how to solve it, Basically, I have the following input XML document: <?xml version="1.0" encoding="UTF-8"?> <parent> <childs> <child ID="1" name="John" /> <child ID="2" name="Marie"/> <child ID="3" name="Joseph"/> </childs> </parent> And I want to add another <child> element to it, but I want to get the child's name from an external file, called 'inputStack.xml', this one: <