Jump to content

How To Do A Chain Operation In Xslt


Krishn60

Recommended Posts

I have a requirement to do a chain operation between 2 XML files and to take an attribute from the 2nd XML file. Please tell me what xsl: function to use. and how to do that. Great, if it is with an example.Here is my first XML file- <Animinations> - <AnimationProto Length=45 Performance="Dilute" - <AnimationsDone> <AnimationOrderRec RecNumEXT="264" /> - </Animations Done>- <Animations>Here is my 2nd XML file- <Cartoons> -<PicturesProfiles Name="Durrel", RecNumExtn="263" Bolondr="Windows"/> -<PicturesProfiles = "Volkrtrn", RecNumExtn="3348" Bolondr="Zilloper"/>- </Cartoons>I need to extract the "Name" attribute from the 2nd file by chaining the RecNumEXT of the first file with the RecNumExtn in the 2nd file. Please let me know.Thanks

Link to comment
Share on other sites

You can use the document() XSLT function to select something from the second XML.For example:

<xsl:template match="AnimationOrderRec"><xsl:value-of select="document('second.xml')//PicturesProfiles[@RecNumExtn=string(current()/@RecNumEXT)]/@Name" /></xsl:template>

Should get the Name attribute of the PicturesProfiles element that has an RecNumExtn attribute like the currently selected AnimationOrderRec element (AnimationOrderRec belonging in the first document in this case).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...