xslkey

Create XML based on 2 XMLs and looking up values in both files using XSLT2.0

穿精又带淫゛_ 提交于 2020-04-30 06:24:49
问题 I am trying to generate a XML based on 2 other XMLs. I am polling a DB that returns details of people(There can be n number of people returned in query). The final XML should have the exact number of Data tags as the distinct name tags in the XML coming from DB . For Ex: 1st XML- Getting this from DB <parent> <child> <name>John</name> <city>Boston</city> </child> <child> <name>John</name> <city>Seattle</city> </child> <child> <name>Allison</name> <city>Houston</city> </child> </parent> 2nd

muenchian grouping

China☆狼群 提交于 2020-01-10 03:13:47
问题 I was wondering how this predicate([1]), is hardcoded as 1 always in the muenchian grouping. The concept was not clear for me, after a lot of search. It is explained as the current node, is compared with the 1st group returned by the key. Why does it always compare with the first one that a key is matched? Also why are we giving contact[count(. | key('contacts-by-surname', surname)[1]) = 1], the =1 part? again 1 is hardcoded. I referred the below link http://www.jenitennison.com/xslt/grouping

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 external lookup table correct usage - key() function?

此生再无相见时 提交于 2020-01-03 05:26:06
问题 I have searched around and found some tutorials for xsl:key and key() function, but somehow I still am missing some understanding apparently. There is a XML-XML transformation I need to do, which includes some 10 fields where you I have to take string values from source XML, find appropriate numeric codes from appropriate lookup tables (provided), and put those codes in resulting XML. I have a working version of this doing xsl:for-each for lookup table, but I suspect it is suboptimal and

Grouping nested elements in xslt 1.0

帅比萌擦擦* 提交于 2019-12-24 17:11:30
问题 I've been looking at examples of Muenchian grouping in XSLT 1.0, specifically this example here. However I'm unable to get it working on a more complex XML structure. My XML currently looks like this: <?xml version="1.0" encoding="utf-8"?> <ContestResults> <Contests> <Contest sportId="35"> <Sport>Beach Volleyball</Sport> <Event>Men's</Event> <Ranks> <Rank position="1" eventId="1"> <Athlete>Athlete 1a / Athlete 2a [GER]</Athlete> <Result>2</Result> </Rank> <Rank position="2" eventId="1">

XSLT 1.0 Grouping Key for different Nodes and Elements

﹥>﹥吖頭↗ 提交于 2019-12-08 02:59:49
问题 I am looking at the Muenchian Grouping. I tried finding examples that are similar to my xml but can't find any. Most of the examples are well structured while mine is confusing. Here's a shortened version of my XML (note that I can't change the XML structure because it's a standard thing and out of my hands), and I'm using XSLT 1 because the system only supports that version now. <object> <creator id="123"> <name>ABC</name> <city>Hamilton</city> </creator> <creator><references>456</references

XSLT 1.0 Grouping Key for different Nodes and Elements

。_饼干妹妹 提交于 2019-12-06 04:45:11
I am looking at the Muenchian Grouping. I tried finding examples that are similar to my xml but can't find any. Most of the examples are well structured while mine is confusing. Here's a shortened version of my XML (note that I can't change the XML structure because it's a standard thing and out of my hands), and I'm using XSLT 1 because the system only supports that version now. <object> <creator id="123"> <name>ABC</name> <city>Hamilton</city> </creator> <creator><references>456</references></creator> <contact><references>123</references></contact> <creator id="456"> <name>XYZ</name> <city

xsl:key not working when looping through nodeset obtained with xalan:nodeset

删除回忆录丶 提交于 2019-12-06 02:42:12
问题 I have found a case where xsl:key seems not to be working. I am using XSLT 1 with Xalan (compiled) and this is what is happening: 1.- This works: key named test1 works fine: <xsl:variable name="promosRTF"> <xsl:copy-of select="promo[@valid='true']"/> </xsl:variable> <xsl:variable name="promos" select="xalan:nodeset($promosRTF)" /> <!-- now the key: when defined and used here it works fine: --> <xsl:key name="test1" match="//promo" use="'anytext'" /> <xsl:for-each select="key('test1','anytext'

xsl:key not working when looping through nodeset obtained with xalan:nodeset

半城伤御伤魂 提交于 2019-12-04 07:33:00
I have found a case where xsl:key seems not to be working. I am using XSLT 1 with Xalan (compiled) and this is what is happening: 1.- This works: key named test1 works fine: <xsl:variable name="promosRTF"> <xsl:copy-of select="promo[@valid='true']"/> </xsl:variable> <xsl:variable name="promos" select="xalan:nodeset($promosRTF)" /> <!-- now the key: when defined and used here it works fine: --> <xsl:key name="test1" match="//promo" use="'anytext'" /> <xsl:for-each select="key('test1','anytext')/*"> loop through elements in key... ok, works fine </xsl:for-each> <xsl:for-each select="$promos/*">

muenchian grouping

限于喜欢 提交于 2019-11-29 08:08:47
I was wondering how this predicate([1]), is hardcoded as 1 always in the muenchian grouping. The concept was not clear for me, after a lot of search. It is explained as the current node, is compared with the 1st group returned by the key. Why does it always compare with the first one that a key is matched? Also why are we giving contact[count(. | key('contacts-by-surname', surname)[1]) = 1], the =1 part? again 1 is hardcoded. I referred the below link http://www.jenitennison.com/xslt/grouping/muenchian.html I was wondering how this predicate([1]), is hardcoded as 1 always in the muenchian