xslt-1.0

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

how to merge two nodes having “the same father” and having a precise “method” sequence (using XSLT)?

白昼怎懂夜的黑 提交于 2019-12-12 10:29:50
问题 I need to merge the two nodes MANHATTAN: because our system rule is the following: " CREATE A + MODIFY A" is still a " CREATE A with the merged attributes" input file: <?xml version="1.0" encoding="UTF-8"?> <world> <COUNTRY id="USA" > <STATE id="NEW JERSEY"> <CITY id="NEW YORK" method="modify"> <DISTRICT id="MANHATTAN" method="create"> <attributes> <population>99 </population> <income> 10000</income> </attributes> </DISTRICT> <DISTRICT id="MANHATTAN" method="modify"> <attributes> <temperature

Grouping the nodes at three levels and summing one node

喜你入骨 提交于 2019-12-12 10:22:27
问题 Please follow the comments in the sample xml it explains everything I need, it is having three scenerio's check each scenerio in the output xml in the same sequence. Input XML <!-- In the below xml there will be one ASNInDesc with multiple ASNInPO's and each ASNInPO contains one ASNInCtn and each ASNInCtn contains one ASNInItem --> <ASNInDesc> <asn_nbr>ASN-1</asn_nbr> <!-- In the below two ASNInPO's po_nbr is same container_id under ASNInCtn is same and item_id under ASNInItem is same. In

XSLT to lookup values in one XML and replace in another XML file

流过昼夜 提交于 2019-12-12 09:57:16
问题 One of the products we work with is able to output configuration information as XML, but, in that output file, instead of including actual host identifiers (names), they use a kind of GUID reference for each of the identifiers. I have made an XML file that contains the "mapping" between the host identifiers GUIDs and the actual host identifiers(lookup), and I want to implement an XSLT that will go through the configuration file and replace all of the host identifier GUIDs with the host

How to eliminate duplicate nodes bases on values of multiple attributes?

☆樱花仙子☆ 提交于 2019-12-12 09:19:43
问题 How can I eliminate duplicate nodes based on values of multiple (more than 1) attributes? Also the attribute names are passed as parameters to the stylesheet. Now I am aware of the Muenchian method of grouping that uses a <xsl:key> element. But I came to know that XSLT 1.0 does not allow paramters/variables in <xsl:key> . Is there another method(s) to achieve duplicate nodes removal? It is fine if it not as efficient as the Munechian method. Update from previus question: XML: <data id = "root

Output once if both xml tags occur at the same time

只谈情不闲聊 提交于 2019-12-12 06:23:49
问题 If both xml tags exist I only want the output of the transform to occur once. Is that possible? xsl <xsl:template match="latitude | longitude"> <generate_once>for both tags below</generate_once> </xsl:template> xml <doc> <latitude /><longitude /> </doc> 回答1: Will this template do the trick...? <xsl:template match="latitude | longitude[not(../latitude)]"> <generate_once>for both tags below</generate_once> </xsl:template> This works by matching latitude if it exists (regardless of whether there

Find Parent based on children- Xslt 1.0

ぃ、小莉子 提交于 2019-12-12 05:48:10
问题 I have an Xml having two main elements named "Pattern" and "Members" <Root> <Pattern name="A"> <Member id="2" /> <Member id="3" /> <Member id="6" /> <Member id="20" /> </Pattern> <Pattern name="B"> <Member id="3" /> <Member id="4" /> </Pattern> <Pattern name="C"> <Member id="11" /> <Member id="13" /> <Member id="14" /> </Pattern> <Members> <Member id="1" name="Member1" > <Member id="2" name="Member2" > <Member id="3" name="Member3" /> <Member id="4" name="Member4" /> </Member> <Member id="5"

XML to XML with XSLT (Remove, add, alter)

不问归期 提交于 2019-12-12 05:38:07
问题 I have to convert from one XML (XHTML) file to another using XSLT. The rules of transformation are: <div id="ta12" class="bl" style="dis:bl"> has to be replaced with <div class="pass" value="50"> The values of id="t0b" and "t1b" have to be replaced with id="ta0b8" and "ta3b8" respectively. <input type="radio" name="o0" id="t0"/> has to be replaced with <input type="radio" name="key0b8" value="0" id="ta0q" class="block" /> (And likewise in the file) Input file: <?xml version="1.0" encoding=

Formatting DateTime in xslt 1.0

落爺英雄遲暮 提交于 2019-12-12 05:36:42
问题 I am trying to Format my DateTime 2005-08-01T12:00:00 in XSL 1.0. I tried using substring functions but 'T' is still coming. I want my output to come like this - <YEAR>2005</YEAR> <MONTH>08</MONTH> <DAY>01</DAY> <HOUR>12<HOUR/> <MINUTE>00<MINUTE/> <SECOND>00<SECOND/> How to write snippet of this and remove 'T' from the incoming value? 回答1: You can use the substring function for this. Remember, that that the indexing of each character in the string starts at 1 not 0. So, to get the year you

XML to XAML transformation using XSLT 1.0 | Exclude specific transformations for some controls

谁都会走 提交于 2019-12-12 05:34:25
问题 Let say I have the following XML Code <PanelWrapper id="RootPanel" width="800" height="600" forecolor="Black"> <ButtonWrapper id="button" text="click!" forecolor="Black"> <TabIndex>0</TabIndex> <TabStop>True</TabStop> </ButtonWrapper> </PanelWrapper> This Code should be transformed into XAML Code using XSLT 1.0: <WrapPanel Name="RootPanel" Width="800" Height="600"> <Button Name="button" Content="click!" Foreground="Black" TabIndex="0" IsTabStop="True"> </Button> </WrapPanel> I'm currently