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

RE: Re: Spam: Xsl:variable question

Subject: RE: Re: Spam: Xsl:variable question
From: "Emerson, Matt" <Matt.Emerson@xxxxxxx>
Date: Mon, 26 Sep 2005 16:15:26 -0400
matt emerson
Hi Jay,

Is the order of declaration what's important in the document, or does
the parser detect dependencies so that this would work...?

<xsl:stylesheet>

                <xsl:variable name="C">
                                 some processing dependent on A,B,etc.
                 </xsl:variable>

                 <xsl:variable name="B">
                                 some processing dependent on B
                 </xsl:variable>

                 <xsl:variable name="A">
                                 some processing...
                 </xsl:variable>

                 <xsl:template match="/">
                                 transform
                 </xsl:template>
</xsl:stylesheet>

I assume that the former is the case, but you never know.

Thanks,

Matt

-----Original Message-----
From: JBryant@xxxxxxxxx [mailto:JBryant@xxxxxxxxx]
Sent: Monday, September 26, 2005 4:18 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Re: Spam: Xsl:variable question


Hi, Matt,

For the most part, yes. However, beware of circular definitions (which
no
language can handle).

<xsl: variable name="a">
  some processing dependent on the value of $b
</xsl:variable>

<xsl: variable name="b">
  some processing dependent on the value of $a
</xsl:variable>

will break.

And while it looks simple in this very obvious case, it can be hell to
figure out in practice, when it's halfway through 3,000 lines of souce
code in multiple files. So I try to keep those kinds of things together
in
the same file and write comments so that I can figure out what I did
when
I come back to that stretch of code next year.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)




"Emerson, Matt" <Matt.Emerson@xxxxxxx>
09/26/2005 02:56 PM
Please respond to
xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To
<xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
cc

Subject
Spam: Xsl:variable question






Hello,

If I declare more than one global variable in a document, can I be
ensured that the global variables will be instantiated in a particular
order?

For instance, if I do this,

<xsl:stylesheet>

                 <xsl:variable name="A">
                                 some processing...
                 </xsl:variable>

                 <xsl:variable name="B">
                                 some processing dependent on B
                 </xsl:variable>

                 <xsl:variable name="C">
                                 some processing dependent on A,B,etc.
                 </xsl:variable>

                 <xsl:template match="/">
                                 transform
                 </xsl:template>
</xsl:stylesheet>

Will I be ensured that C will be processed after B and after A,etc?

Thanks,

Matt

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.