XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
vikram patilSubject: Using XSL files to transform xml file to text file
Author: vikram patil
Date: 14 Jul 2006 04:38 AM
I have a requirement of sorting attribute of one xml node with respect to the value of one node in other xml node
eg.
<variable name="a">
<xsl:for-each select=XPATH>
<@name>
</xsl:for-each>
</variable>

<variable name b>
<sortelem>X</sortelem>
</variable>

I want the value in ascending order according to sortItem value
Vikram

Postnext
Ivan PedruzziSubject: Using XSL files to transform xml file to text file
Author: Ivan Pedruzzi
Date: 14 Jul 2006 11:14 AM
Vikram,

Sorry from your code is not clear what final goal is.

Could you post a fragment of the input document you would like to process and the a fragment of the expected result?

Ivan Pedruzzi
Stylus Studio Team

Postnext
vikram patilSubject: Using XSL files to transform xml file to text file
Author: vikram patil
Date: 14 Jul 2006 11:42 PM
one of the input file:
<component xsi:type="PinJoint" name="r_palm_ring" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id>
<componentType>J</componentType>
<componentNumber>16</componentNumber>
</id>
<parentId>
<componentType>B</componentType>
<componentNumber>5</componentNumber>
</parentId>
....


other input file....
<jointOrderedItem>
<seqNum>6</seqNum>
<id>
<ns11:componentType xmlns:ns11="http://www.cgtechnical.com/ami/genericModel/mstns">J</ns11:componentType>
<ns12:componentNumber xmlns:ns12="http://www.cgtechnical.com/ami/genericModel/mstns">19</ns12:componentNumber>
</id>
<distalJointConnection>1</distalJointConnection>
</jointOrderedItem>
<jointOrderedItem>
<seqNum>7</seqNum>
<id>
<ns13:componentType xmlns:ns13="http://www.cgtechnical.com/ami/genericModel/mstns">J</ns13:componentType>
<ns14:componentNumber xmlns:ns14="http://www.cgtechnical.com/ami/genericModel/mstns">18</ns14:componentNumber>
</id>
<distalJointConnection>2</distalJointConnection>
</jointOrderedItem>
<jointOrderedItem>
<seqNum>8</seqNum>
<id>
<ns15:componentType xmlns:ns15="http://www.cgtechnical.com/ami/genericModel/mstns">J</ns15:componentType>
<ns16:componentNumber xmlns:ns16="http://www.cgtechnical.com/ami/genericModel/mstns">17</ns16:componentNumber>
</id>
<distalJointConnection>3</distalJointConnection>
</jointOrderedItem>
<jointOrderedItem>
<seqNum>9</seqNum>
<id>
<ns17:componentType xmlns:ns17="http://www.cgtechnical.com/ami/genericModel/mstns">J</ns17:componentType>
<ns18:componentNumber xmlns:ns18="http://www.cgtechnical.com/ami/genericModel/mstns">16</ns18:componentNumber>
</id>
<distalJointConnection>4</distalJointConnection>
</jointOrderedItem>
<jointOrderedItem>
<seqNum>10</seqNum>
<id>
<ns19:componentType xmlns:ns19="http://www.cgtechnical.com/ami/genericModel/mstns">J</ns19:componentType>
<ns20:componentNumber xmlns:ns20="http://www.cgtechnical.com/ami/genericModel/mstns">23</ns20:componentNumber>
</id>
<distalJointConnection>5</distalJointConnection>
</jointOrderedItem>
</jointOrdering>

xsl files

<xsl:variable name="outjListing">
<xsl:for-each select="../mstns:component[(fn:ends-with(string( @xsi:type ), 'Joint')) and (mstns:parentId/mstns:componentType = $segmentType) and (mstns:parentId/mstns:componentNumber = $segmentNumber)]">
|OUTJ
<xsl:value-of select="@name" />
</xsl:for-each>
</xsl:variable>
RConnTagsString "SENS
<xsl:value-of select="$outjListing" />

I want the outjListing variable sorted according to the
distaljointconnection tag in the second input file
Can you provide me your email address
Mine is vikram123patil@hotmail.com

Posttop
Ivan PedruzziSubject: Using XSL files to transform xml file to text file
Author: Ivan Pedruzzi
Date: 15 Jul 2006 06:08 PM

Hi Vecram,

Please have a look to the attached Stylus Studio project it should be a good start.



Ivan Pedruzzi
Stylus Studio Team


Documentjoint-component.zip

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.