xslt

Add element between two other elements via XSLT?

半腔热情 提交于 2020-12-11 01:02:13
问题 I have the following input XML: <root> <aaa>some string aaa</aaa> <bbb>some string bbb</bbb> <ddd>some string ddd</ddd> </root> Using XSLT I want to the following output: <root> <aaa>some string aaa</aaa> <bbb>some string bbb</bbb> <ccc>some string ccc</ccc> <ddd>some string ddd</ddd> </root> My XSLT is: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select=

Add element between two other elements via XSLT?

时光毁灭记忆、已成空白 提交于 2020-12-11 01:00:00
问题 I have the following input XML: <root> <aaa>some string aaa</aaa> <bbb>some string bbb</bbb> <ddd>some string ddd</ddd> </root> Using XSLT I want to the following output: <root> <aaa>some string aaa</aaa> <bbb>some string bbb</bbb> <ccc>some string ccc</ccc> <ddd>some string ddd</ddd> </root> My XSLT is: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select=

Add element between two other elements via XSLT?

守給你的承諾、 提交于 2020-12-11 00:49:48
问题 I have the following input XML: <root> <aaa>some string aaa</aaa> <bbb>some string bbb</bbb> <ddd>some string ddd</ddd> </root> Using XSLT I want to the following output: <root> <aaa>some string aaa</aaa> <bbb>some string bbb</bbb> <ccc>some string ccc</ccc> <ddd>some string ddd</ddd> </root> My XSLT is: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select=

How to select first and last elements via XPath?

不想你离开。 提交于 2020-12-08 05:49:25
问题 Here is a sample XML, and I am trying to figure out how to select first node value and exit the loop. If I use following XSLT tag <xsl:value-of select="fruits/fruit"/> it returns "apple mango banana" but expected result should be "apple" <fruits> <fruit>apple</fruit> <fruit>mango</fruit> <fruit>banana</fruit> </fruits> I'd also like to select the last fruit without knowing how many fruit exist a priori. So, for the above example, I'd like to return "banana" without knowing that there are 3

Matching templates with different configuration on the same node

扶醉桌前 提交于 2020-11-29 21:06:40
问题 I asked my entire question here on stack overflow, I'll try to chop it up: I need to make an xml from this source: very briefly: <?xml version="1.0" encoding="UTF-8"?> <FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult"> <ROW> <EDI_DC40.TABNAM><DATA>EDI_DC40</DATA></EDI_DC40.TABNAM> <E1EDL20.VBELN><DATA>649758</DATA></E1EDL20.VBELN> <E1EDL18.QUALF><DATA>ORI</DATA></E1EDL18.QUALF> <E1EDT13.1.QUALF><DATA>007<DATA></E1EDT13.1.QUALF> <E1EDT13.2.QUALF><DATA>015</DATA></E1EDT13.2.QUALF>

xsl automatically show xml data without hardcoding

∥☆過路亽.° 提交于 2020-11-25 04:16:23
问题 this is the xml data i have <?xml version="1.0" encoding="UTF-8"?> <!--xsl file link--> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <!--xsd file link--> <forecast qTime="28/10/20 10:00 PM" qLocation="Singapore"> <weather yyyymmdd="20200430"> <year>2020</year> <month>04</month> <date>30</date> <comment>Plenty of sunshine</comment> <code>sunny</code> <highest>32.6</highest> <lowest>28.4</lowest> </weather> <weather yyyymmdd="20200218"> <year>2020</year> <month>02</month> <date>18</date>

xsl automatically show xml data without hardcoding

岁酱吖の 提交于 2020-11-25 04:09:51
问题 this is the xml data i have <?xml version="1.0" encoding="UTF-8"?> <!--xsl file link--> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <!--xsd file link--> <forecast qTime="28/10/20 10:00 PM" qLocation="Singapore"> <weather yyyymmdd="20200430"> <year>2020</year> <month>04</month> <date>30</date> <comment>Plenty of sunshine</comment> <code>sunny</code> <highest>32.6</highest> <lowest>28.4</lowest> </weather> <weather yyyymmdd="20200218"> <year>2020</year> <month>02</month> <date>18</date>