XML Transforming Help

Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2006
Posts: 22
Reputation: hanifa is an unknown quantity at this point 
Solved Threads: 0
hanifa hanifa is offline Offline
Newbie Poster

XML Transforming Help

 
0
  #1
Jan 17th, 2007
This is my input.xml file. input.xml

This is my output.xml
output.xml

This is xsl transformer file.
tranformer.xsl

Hi guys, looks at the commented sections in all the three files.

Thanks for any help.. Basically i need help in modifying the transformer file.
So that the <extendedattributes> tag in the input file can be read as and outputted as a sibling to the <ntask> tag in the output file.

Thanks for any hints and idears.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: XML Transforming Help

 
0
  #2
Jan 19th, 2007
Hm. You should be able to do something like this in your 'Activity' template in the XSL file.

XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <xsl:variable name="get_from"><xsl:value-of select="@Id"/></xsl:variable>
  2. <xsl:copy-of select="/Package/Transitions/Transition[@From = $get_from]/ExtendedAttributes"/>
(I haven't tested that, I have no useable XSLT processor on this PC at this moment)

Your input XML file is a bit confusing.. But it does highlight one of the inherant difficulties in XML; showing relationships between sibling nodes (other than order-based relationships)...

I'm not quite sure if I get exactly what you're trying to do though; do you want the ExtendedAttributes in the Transition node with the same "From" attribute as the currently processed Activity node's "Id" attribute, to be placed in the <ntask> output node that's currently being processed?

Post back if that isn't the case.
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC