xslt-grouping

Removing duplicate in XSLT for node having multiple value

a 夏天 提交于 2020-01-07 02:22:35
问题 I have a sample XML which has duplicate node. Node 1 and Node3 with below temperature code and both values in FAH and CC are duplicate. All value within row node needs to be checked to checked to termed it as duplicate node <row> <attr name="temperatureCode">STORADE</attr> <attrQualMany name="temperature"> <value qual="FAH">10</value> <value qual="CC">20</value> </attrQualMany> </row> This sample message is <document> <party> <gtin>1000909090</gtin> <pos> <attrGroupMany name=

Counting distinct items in XSLT and listing only once

帅比萌擦擦* 提交于 2020-01-06 19:53:25
问题 I have the following XML: <assessment> <section> <item> <attributes> <variables> <variable> <variable_name value="MORTIMER"/> </variable> </variables> </attributes> </item> <item> <attributes> <variables> <variable> <variable_name value="FRED"/> </variable> </variables> </attributes> </item> <item> <attributes> <variables> <variable> <variable_name value="MORTIMER"/> </variable> </variables> </attributes> </item> </section> </assessment> I have the following XSLT to process that XML: <xsl

xslt xml getting first occurrence and merging the tags

徘徊边缘 提交于 2020-01-06 05:41:05
问题 Below is the XML and I am looking for output as below Input XML (xml version="1.0") <dynamic> <rpc xmlns="http://namespace/example" > <route> <table> <tablename>employee</tablename> <count>20</count> </table> <table> <tablename>employee</tablename> <count> 21</count> <rt> 1</rt> <rt> 2</rt> <rt> 3</rt> <rt> 4</rt> </table> <table> <tablename>dept</tablename> <count>20</count> <rt> a</rt> <rt> b</rt> <rt> c</rt> </table> <table> <tablename>dept</tablename> <count>44</count> <rt> d</rt> <rt> e<

How to group consecutive dates in XSLT?

巧了我就是萌 提交于 2020-01-06 04:45:06
问题 I have an xml file (sample below) and I want to group this xml based on consecutive Time_Off_Date. <Root> <Entry> <Employee_ID>101</Employee_ID> <Time_Off_Details> <Time_Off_Date>2017-12-01</Time_Off_Date> </Time_Off_Details> <Time_Off_Details> <Time_Off_Date>2017-12-02</Time_Off_Date> </Time_Off_Details> <Time_Off_Details> <Time_Off_Date>2017-12-04</Time_Off_Date> </Time_Off_Details> <Time_Off_Details> <Time_Off_Date>2017-12-05</Time_Off_Date> </Time_Off_Details> </Entry> <Entry> <Employee

How to count distinct values in a node?

…衆ロ難τιáo~ 提交于 2019-12-29 04:18:06
问题 How to count distinct values in a node in XSLT? Example: I want to count the number of existing countries in Country nodes, in this case, it would be 3. <Artists_by_Countries> <Artist_by_Country> <Location_ID>62</Location_ID> <Artist_ID>212</Artist_ID> <Country>Argentina</Country> </Artist_by_Country> <Artist_by_Country> <Location_ID>4</Location_ID> <Artist_ID>108</Artist_ID> <Country>Australia</Country> </Artist_by_Country> <Artist_by_Country> <Location_ID>4</Location_ID> <Artist_ID>111<

XSLT grouping on multiple keys using Muenchian method

旧城冷巷雨未停 提交于 2019-12-28 06:39:08
问题 This is the input file. All these blocks are wrapped in a <allocfile> tag which is not appearing, dunno why? And all these blocks are wrapped in a top level element <xml> . <XML> <AllocFile> <alc>1</alc> <No>11/10</No> <DT>20090401</DT> <G_H>147</G_H> <FUN>125487</FUN> <oH>11</oH> <y>9</y> <AMOUNT>8000000</AMOUNT> <Code>033195</Code> <hd1>1234</hd1> </AllocFile> <AllocFile> <alc>2</alc> <No>14/10</No> <DT>20090401</DT> <G_H>147</G_H> <FUN>125487</FUN> <oH>11</oH> <y>9</y> <AMOUNT>8400000<

Slightly complex grouping based on node values using XSLT 1.0

谁说我不能喝 提交于 2019-12-25 06:31:11
问题 My requirement is slightly complex one.I have to use only XSLT 1.0. I could able to get the solution using XSLT 2.0, but I need the solution using 1.0. I have the following input xml: <results> <row> <CASEID>C1</CASEID> <CASEBA>MEDICAID</CASEBA> <ISSUEID>I1</ISSUEID> <ISSUEBA>MEDICAID</ISSUEBA> <OBJECTID>1</OBJECTID> <OBJECTBA>MEDICAID</OBJECTBA> </row> <row> <CASEID>C1</CASEID> <CASEBA>MEDICAID</CASEBA> <ISSUEID>I2</ISSUEID> <ISSUEBA>MEDICAID</ISSUEBA> <OBJECTID>2</OBJECTID> <OBJECTBA

Grouping in XSLT

左心房为你撑大大i 提交于 2019-12-25 05:16:17
问题 Have the source XML: <root> <element Key="card1_id">123</element> <element Key="card1_balance">500</element> <element Key="card2_id">456</element> <element Key="card2_balance">800</element> ............................................. <element Key="card(n)_id">999</element> <element Key="card(n)_balance">8000</element> </root> Where n - the number of cards With XSLT i need to get a HTML: <b>Card 1:</b> ID: 123 <br/> Balance: 500 <br/> <b>Card 2:</b> ID: 456<br/> Balance: 800<br/> ...........

XSLT Mapping using foreach

我只是一个虾纸丫 提交于 2019-12-25 04:13:34
问题 This is the sample XML data that i am using and then i have to pass all the values to an additional properties tag.. <ns1:Quote> <ns1:QuoteVendor>123</ns1:QuoteVendor> <ns1:QuoteNumber>sai</ns1:QuoteNumber> <ns1:QuoteVersion>sri</ns1:QuoteVersion> <ns1:QuoteValue>sas</ns1:QuoteValue> <ns1:QuoteProperty>sandy</ns1:QuoteProperty> </ns1:Quote> After transformation using XSLT i am expecting the format as <AdditionalProperties> <ns1:Properties> <ns1:Propertyname>QuoteVendor</ns1:Propertyname> <ns1

XSLT Sort grandchild nodes and pick the value of another grandchild

為{幸葍}努か 提交于 2019-12-24 21:01:16
问题 I am trying to figure out the XSLT (CSV output) for the below XML. I would like to sort the grandchildren nodes i.e. sort Month node and pick the Sales_Program-ID node value of the set with the highest month value. XML <Root> <Level1> <EMPLID>123</EMPLID> <Program> <Sales_Program Name="XYZ"> <ID1>ab</ID1> </Sales_Program> <Start_Date>Jan1st</Start_Date> **<Month>1</Month>** </Program> <Program> <Sales_Program Name="ABC"> <ID1>cd</ID1> </Sales_Program> <Start_Date>Feb1</Start_Date> **<Month>2<