muenchian-grouping

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<

Select Distinct Element into a node XSLT

馋奶兔 提交于 2019-12-24 19:34:03
问题 This is my XML code: <SECTOR_LIST> <LIGHT_SECTOR> <SECTOR1>22</SECTOR1> <SECTOR2>92</SECTOR2> </LIGHT_SECTOR> <LIGHT_SECTOR> <SECTOR1>22</SECTOR1> <SECTOR2>92</SECTOR2> </LIGHT_SECTOR> <LIGHT_SECTOR> <SECTOR1>92</SECTOR1> <SECTOR2>137</SECTOR2> </LIGHT_SECTOR> <LIGHT_SECTOR> <SECTOR1>92</SECTOR1> <SECTOR2>137</SECTOR2> </LIGHT_SECTOR> </SECTOR_LIST> I create this XSLT 1.0: <xsl:for-each select="SECTOR_LIST"> <xsl:for-each select="LIGHT_SECTOR"> <xsl:text>VIS </xsl:text> <xsl:value-of select=

Change output based on value in xsl:key in XSLT 1.0

吃可爱长大的小学妹 提交于 2019-12-24 07:55:29
问题 I have a fairly large (270mb) XML file that I need to group, sort, and run multiple transforms on. Input XML: <!-- language: lang-xml --> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <EligibilityRecords xmlns="http://Eligibility_LSDD"> <Eligibility_Detail_Record xmlns=""> <PT_PARTICIPANT_FILE_IMP_ID></PT_PARTICIPANT_FILE_IMP_ID> <PT_LST_NM>VALLE</PT_LST_NM> <PT_FRST_NM>FRANKIE</PT_FRST_NM> <EN_PLAN_NAME>Health Reimbursement Arrangement</EN_PLAN_NAME> <EN_MBRSHP_EFF_STRT_DT>01012017<

Filtering, Grouping, Counting and Selecting specific nodes in XML using XSLT 1.0

喜夏-厌秋 提交于 2019-12-13 21:23:36
问题 I've got some XML that looks a little like this. <Dealer> <Vehicle> <Model>KA</Model> <Series>Type A</Series> <Price>1000.00</Price> </Vehicle> <Vehicle> <Model>KA</Model> <Series>Type C</Series> <Price>1400.00</Price> </Vehicle> <Vehicle> <Model>KA</Model> <Series>Type A</Series> <Price>1100.00</Price> </Vehicle> <Vehicle> <Model>FOCUS</Model> <Series>Type B</Series> <Price>5000.00</Price> </Vehicle> <Vehicle> <Model>FIESTA</Model> <Series>Type A</Series> <Price>6000.00</Price> </Vehicle> <

How to improve my Muenchian grouping XSLT?

让人想犯罪 __ 提交于 2019-12-13 20:05:38
问题 Thanks to the help of Niraj and hr_117 I was able to arrive at an XSL template that turns this XML... <bookings> <entry> <event>Christmas</event> <attendees>2</attendees> </entry> <entry> <event>Halloween</event> <attendees>2</attendees> </entry> <entry> <event>Easter</event> <attendees>1</attendees> </entry> <entry> <event>Easter</event> <attendees>1</attendees> </entry> </bookings> ...into this output: Christmas: 1 booking(s) Halloween: 1 booking(s) Easter: 2 booking(s) This is my XSL: <xsl

Muenchian method for nested elements

假装没事ソ 提交于 2019-12-13 18:52:49
问题 my xml input is- <?xml version="1.0" encoding="UTF-8"?> <foo> <bar>bar</bar> <bar>bar</bar> <foobar><baz>baz</baz></foobar> <foobar>foobar</foobar> <bar>bar</bar> <bar>bar</bar> </foo> Output using xslt should be <?xml version="1.0" encoding="UTF-8"?> <foo> <s> <s> <bar>bar</bar> <bar>bar</bar> </s> <s> <foobar><baz>baz</baz></foobar> <foobar>foobar></foobar> </s> <s> <bar>bar</bar> <bar>bar</bar> </s> </s> </foo> the output should have sequence-of elements inside a parent. Mixed sequence-of

How to extend a Muenchian XML grouping?

此生再无相见时 提交于 2019-12-13 04:32:02
问题 I have this XML: <events> <event name="Christmas" attendees="1"/> <event name="Halloween" attendees="3"/> <event name="Easter" attendees="2"/> <event name="Easter" attendees="1"/> </events> Thanks to hr_117 's help, I managed to do this: <xsl:template match="data"> <xsl:apply-templates select="events"/> </xsl:template> <xsl:key name="events-by-name" match="events/event" use="@name" /> <xsl:template match="events"> <xsl:for-each select="event[count(. | key('events-by-name', @name)[1]) = 1]">

XSLT split output files - muenchian grouping

孤者浪人 提交于 2019-12-12 10:53:32
问题 I have an XSLT file so as to transform large amount of data. I would like to add a "split" functionality, either as a chained XSLT or within the current XSLT that can create multiple output files so as to limit the size of the files under a certain threshold. Let's assume that the input XML is as below: <People> <Person> <name>John</name> <date>June12</date> <workTime taskID="1">34</workTime> <workTime taskID="2">12</workTime> </Person> <Person> <name>John</name> <date>June13</date> <workTime

Difficulty with nested XSL for-each statement

戏子无情 提交于 2019-12-12 06:04:42
问题 I am new to XSL and working a bit above my head. I have an xml file (show below) which I wanted to group by month&year. I achieved this with Muenchian Grouping... however that led to a new issue around nested for-each statements. The issue is that all links are now only pointing to the first link in the array, rather than their own. Below my XML is the XSL which has two body statements separated by /// The first is my logic with the grouping, and incorrect linking. The lower one, which is

How to remove duplicates when using xslt

我的未来我决定 提交于 2019-12-12 03:48:44
问题 I am able to remove duplicates from either city1 or city2 or city 3 using Muenchian grouping which is key and generate id as shown below. but am not able to remove duplicates by looping into all city1, city2 and city3 Below is the xml <test> <records> <city1>Sweden</city1> <country1>value1<country1> <town1>value2<town1> <city2>Paris</city2> <country2>value1<country2> <town2>value2<town2> <city3>London</city3> <country3>value1<country3> <town3>value2<town3> </records> <records> <city1>Sweden<