[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Sorting problem in xsl

Subject: Sorting problem in xsl
From: Arulraj <p_arulraj@xxxxxxxxx>
Date: Mon, 11 Apr 2005 03:29:25 -0700 (PDT)
svg draw line
Hello,

I want to do sorting in XSL using the attribute x and
y.

Example:
I have the following XML content.

<draw:text-box>
<draw:control svg:x="0.0937inch" svg:y="0.0626inch"
form:id="control2"/>

<draw:control svg:x="0.0937inch" svg:y="0.3437inch"
form:id="control3"/>

<draw:line    svg:x1="0.1165inch" svg:y1="0.6118inch"
svg:x2="1.7622inch" svg:y2="0.6118inch"/>

<draw:control svg:x="0.0957inch" svg:y="0.6953inch"
form:id="control4"/>

<draw:line svg:x1="0.0752inch" svg:y1="1.122inch"
svg:x2="1.7417inch" svg:y2="1.122inch"/>
</draw:text-box>

In my XSL file, I am doing the sorting by the
following way. 

<xsl:template name="draw:text-box">
<Box>
<xsl:for-each select="child::*">
<xsl:sort order="ascending"
select="number(substring-before(./@svg:y,'inch'))"/>
<xsl:sort order="ascending"
select="number(substring-before(./@svg:x,'inch'))"/>


<xsl:choose>
	<xsl:when test="name()='draw:control'">
		<xsl:call-template name="draw:control"/>
	</xsl:when> 
	<xsl:when test="name()='draw:line'">
		<xsl:call-template name="draw:line"/>
	</xsl:when>
	
</xsl:choose>
</xsl:for-each>
</Box>
</xsl:template>

Question:
In the XML, for the "draw:line" node we don't have 'y'
and 'x' attributes. so, i got the problem to sort
this.
I want to get the following output. How to do sort for
x and x1, y and y1 ?

<box>
<control2>
<control3>
<line1>
<control4>
<line2>
</box>

Any ideas?

Thanks
Regards,
Arul


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.