Subject: RE: [xsl] Searching in Sub-children from an Array From: "Houman Khorasani" <Houman.Khorasani@xxxxxxxxxxx> Date: Wed, 14 Feb 2007 17:27:06 -0000 |
>I believe the problem is in this line: ><xsl:copy-of >select="(key('step',string-join(ancestor-or-self::*[@ID]/@ID,',')),.)[1 ]"/> >The section reading >'(key('step',string-join(ancestor-or-self::*[@ID]/@ID,',')),.)' will >select all matching Rate_Event nodes correctly, as well as the current >node. The predicate at the end '[1]', will then take the first item in >this list. I suspect you want to use some kind of conditional here... You are right!! I had overlooked it. [*] has solved my problem. Many thanks!! One last question, I also had a mistake in the required XML output. Maybe you can help me with that as well please: XML Input is now slightly changed in <Rate_Structure_Event>, which contains now few children called <Rate>: <tree> <fruit ID="111"> <mango ID="333"> <colour> <Rate_Structure_Event ConceptType="Rate_Structure_Event" ID="1"> <Rate>bla</Rate> <Rate>bla</Rate> <Rate>bla</Rate> </Rate_Structure_Event> </colour> </mango> <orange ID="222"> <color>orange</color> </orange> </fruit> <fruit_adjustment> <color> <Path> <Steps>111,333</Steps> </Path> <bla>false</bla> <Rate_Event ConceptType="Rate_Event" ID="A"></Rate_Event> <Rate_Event ConceptType="Rate_Event" ID="B"></Rate_Event> </color> </fruit_adjustment> </tree> Desired XML Output: Exactly like before; but all <Rate> elements inside <Rate_Structure_Event> shall be eliminated and replaced by all <Rate_Event> inside <Fruit_adjustment> (Where the key is referring to obviously, that's why we used Muecnhian Method). Only that the new <Rate_Event> elements shall be actually renamed to <Rate>. In other words the structure of the ouput doesn't change, the old <Rate> are eliminated and new rates called <Rate_Event> replaces them without forcing the element name to be changed from <Rate> to <Rate_Event>. If this is not clear, I could give a simple example. Many thanks for your advice, Houman
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Searching in Sub-children, Ronan Klyne | Thread | RE: [xsl] Searching in Sub-children, Houman Khorasani |
Re: [xsl] Peserving html in xsl:val, Andrew Welch | Date | Re: [xsl] Peserving html in xsl:val, Mukul Gandhi |
Month |