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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Duplicate Ouput on Repeating E... (2)
-> + How to canculate grand total. (3)
-> + Displaying two xml files toget... (2)
-> + Replace xml attribs vals with ... (2)
-> + check mark - font problem? (5)
-> + Xml to XML with XSLT (Remove) (10)
-> + Problem viewing xml as html wi... (4)
-> + Need to create lunk through XM... (2)
-> - Pagination with xslt (1)
-> + Transform to text using xslt (5)
-> + Rotating text using XSL FO (2)
-> + XSL -- Trim blanks from a vari... (3)
-> + dynamic matching (4)
-> + XSL:key for each condition - p... (5)
-> + XSL does not sort (5)
-> + CAN i CREATE INTERMEDIATE XML ... (2)
-> + Xml to html conversion (3)
-> + Using Xpath against Variables ... (9)
-> + XML-22004: (Fatal Error) Error... (10)
-> + Current page number (3)
-- Previous [1381-1400] [1401-1420] [1421-1440] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.