xslt-grouping

parsing though xml recursively using xslt

微笑、不失礼 提交于 2019-12-12 02:17:50
问题 I have an Xml as follows: <Soap:Envelope> <Soap:Body> <A> <B>Text</B> <C>Text</C> <D> <D1>Text</D1> <D2> <D3>Text</D3> <D4>Text</D4> </D2> </D> <E> <E1> <E2> <E3>Text</E3> </E2> </E1> </E> </A> </Soap:Body> </Soap:Envelope> How do I recursively parse through all the tags(I only know that I will be receiving an xml template), know the tag names and the "Text" in them using XSLT? I need to store the data in the format as below.Below answer works fine when I don't have and tags. How to get the

extract value from an array in xslt

随声附和 提交于 2019-12-12 01:22:44
问题 I have variable 'temperatureQualifier' whose type is array. I need to read that array variable and extract each value from the array and use it in my XSLT. Sample Input XML is <document> <item> <gtin>1000909090</gtin> <flex> <attrGroupMany name="tradeItemTemperatureInformation"> <row> <attr name="temperatureQualifier">[10, 20, 30, 40]</attr> </row> </attrGroupMany> </flex> </item> </document> Desired Output XML should be <?xml version="1.0" encoding="UTF-8"?> <CatalogItem> <RelationshipData>

Specific order for XSL Template output

淺唱寂寞╮ 提交于 2019-12-11 18:37:44
问题 I've got the following xml file: <section> <templateId root="2.16.840.1.113883.10.20.22.2.4" /> <text> <list listType="ordered"> <item>9/18/2013 - Weight - 125 lbs</item> <item>9/18/2013 - Blood Pressure - 120/80 mm Hg</item> <item>9/18/2013 - BMI - 19 98</item> <item>9/11/2013 - Weight - 125 lbs</item> <item>9/11/2013 - Blood Pressure - 120/80 mm Hg</item> <item>9/11/2013 - BMI - 19 98</item> <item>9/11/2013 - Pulse - 32</item> </list> </text> </section> I have the following xsl template

XSL transformation - XML data to different HTML tables

爱⌒轻易说出口 提交于 2019-12-11 16:35:11
问题 Hello how would looks XSL stylesheet for example for this XML code? I tried something according to this question (below) but my output did not look as I want below. XSL transformation - XML data to HTML table XML code <?xml version="1.0" encoding="utf-8" ?> <root> <sample time="14" label="Test1:cpu_2:usage_high"> <value>96</value> </sample> <sample time="14" label="Test1:cpu_2:usage_low"> <value>1</value> </sample> <sample time="1" label="Test1:cpu_1:usage_high"> <value>97</value> </sample>

Merging tags based on two different complex tags

谁说我不能喝 提交于 2019-12-11 14:11:28
问题 In the below two ASNInPO's po_nbr is same container_id under ASNInCtn is same and item_id under ASNInItem is different. In this case two ASNInPO's has to be merged and two ASNInCtn's has to be merged into one tag. This is my Input: <?xml version = '1.0' encoding = 'UTF-8'?> <ASNInDesc> <asn_nbr>ASN-1</asn_nbr> <ASNInPO> <po_nbr>PO-2</po_nbr> <ASNInCtn> <container_id>CONTAINER-2</container_id> <ASNInItem> <item_id>ITEM-2</item_id> <unit_qty>3</unit_qty> </ASNInItem> </ASNInCtn> </ASNInPO>

XSLT: Do a group by twice, first within the same tag, and then by 2 different tags

与世无争的帅哥 提交于 2019-12-11 13:04:39
问题 I want to group the following XML: <DataSet> <FirstNode> <UniqueKey>111</UniqueKey> <OtherKey>552</OtherKey> </FirstNode> <FirstNode> <UniqueKey>123</UniqueKey> <OtherKey>552</OtherKey> </FirstNode> <FirstNode> <UniqueKey>154</UniqueKey> <OtherKey>553</OtherKey> </FirstNode> <SecondNode> <FirstNodeKey>111</FirstNodeKey> </SecondNode> <SecondNode> <FirstNodeKey>123></FirstNodeKey> </SecondNode> <SecondNode> <FirstNodeKey>154></FirstNodeKey> </SecondNode> </DataSet> I want to produce the

How to parse XML using XSLT?

回眸只為那壹抹淺笑 提交于 2019-12-11 08:27:57
问题 I have an XML with data as follows <Item1> <item2> <Item3>111</Item3> <Item2> </Item11> To get the value 111 in Item3 <xsl:choose> <xsl:value-of select="Item1/Item2/Item3"/> </xsl:choose> In XSLT . Now I need to get the following: <Product1> <Product2> <Product3 ValidYN="Y" ProducType="ABC">333</Product3> <Product3 ValidYN="Y" ProducType="DEF">444</Product3> <Product3 ValidYN="Y" ProducType="GHI">555</Product3> <Product12> </Product1> I need to take values 333 , 444 , 555 based on ProducType

Grouping and counting in XSLT 1.0

故事扮演 提交于 2019-12-11 02:46:38
问题 I have input XML: <?xml version="1.0" encoding="UTF-8"?> <root> <FT>Paket</FT> <FT>Parti</FT> <FT>Paket</FT> <FT>Styche</FT> <FT>Styche</FT> </root> And I want my output to display such as - Paket 2 Parti 1 Styche 2 Its is grouping the value of elements and the no. is showing the total count of the value being repeated. Like Paket is indicating the value and it is being repeated 2 times in the XML. How the logic will work? 回答1: In XSLT 1.0, using Muenchian grouping: <xsl:stylesheet version="1

XSLT Group/merge childs (using key)

删除回忆录丶 提交于 2019-12-11 00:55:27
问题 I am trying to understand how to deduce a solution using a code I already wrote. In order to simplify I will explain first what I want to do and what I got so far. Suppose I have an XML variable in XSLT containing few nodes with the same title attribute. Using @Dimitre Novatchev solution I have managed to combine them into one node. So If I had : <t> <GroupData ID="xxx" Key="4" Temp="yyy"> <ItemData ID="zzz" Value="3"/> </GroupData> <GroupData ID="yyy" Key="4" Temp="yyy"> <ItemData ID="abc"

XSLT 1.0 - Concatenate known child nodes, group by unknown parent

老子叫甜甜 提交于 2019-12-10 22:18:00
问题 I want to transform <entry> <parent1> <object_id>1580</object_id> </parent1> <parent1> <object_id>1586</object_id> </parent1> <parent2> <object_id>1582</object_id> </parent2> <parent2> <object_id>1592</object_id> </parent2> </entry> into <entry> <parent1>1580-1586</parent1> <parent2>1582-1592</parent2> </entry> Top-level entry name is unknown. Parent names are unknown, and the number of parent nodes with the same name can vary. Child nodes are known "object_id". So, I would like to group the