944,218 Members | Top Members by Rank

Ad:
Jan 17th, 2007
0

XML Transforming Help

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hanifa is offline Offline
22 posts
since Jul 2006
Jan 19th, 2007
0

Re: XML Transforming Help

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.
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in XML, XSLT and XPATH Forum Timeline: XML Transformations
Next Thread in XML, XSLT and XPATH Forum Timeline: Xml file extraction query





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC