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

Enforcing element order

Subject: Enforcing element order
From: ms <mina_hurray@xxxxxxxxx>
Date: Wed, 2 May 2007 12:53:32 -0700 (PDT)
 Enforcing element order
Hi:

I have an xml input file as shown below:

<mfunc>
<text><para> </para></ text>

<image><title> </title>< /image>
<table></table>
<text><para> </para></ text>
<text><para> </para></ text>
<image><title> </title>< /image>

<l1>
.....
</l1>

<image><title> </title>< /image>
<table></table>
<text><para> </para></ text>

</mfunc>

As you can see elements image, table and text can
appear before and
after <l1>. Now in the PDF, I want all image, text and
table elements
to appear before l1 and the ones after to appear after
l1.

Here is my XSLFO piece for tjis part:

<xsl:choose>
<xsl:when test="*[self: :image[following -sibling:
:table] or
self::image[ following- sibling:: text] or
self::image] ">
<xsl:apply-template s select="*[not( self::image) and
not(self::table[ preceding: :image]) and
not(self::text[ preceding: :image])] "/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-template s/>
</xsl:otherwise>
</xsl:choose>

The issue I am facing here is:

1) becos of "<xsl:apply- templates select="*[not(
self::image) ...."
Any image that appears before <l1> is forced to the
end after l1.

2) The same holds true for text and table elements.

Can anyone suggest a different apprach to this
problem?

Thanks in advance for your help.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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-2007 All Rights Reserved.