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

Re: conditional inclusions2

Subject: Re: conditional inclusions2
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 2 Nov 2000 17:23:29 -0400 (EST)
conditional xml
Ronald,

>Too bad you can't "sub-render" conditional xml entities before you insert 
>them in the actuall output tree.
>Or can you?

I'm not sure that I've interpreted 'sub-render' properly, but you can
certainly insert the result of transforming an imported document in a
variable, and then do a few things to check the content of that variable
(even more if you're happy to use the node-set extension).  For example:

  <xsl:template match="if">
    <xsl:variable name="imported-tree">
      <xsl:choose>
        <xsl:when test="@include='1'">
          <xsl:apply-templates select="document('file1.xml')"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="document('file2.xml')"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>

    <!-- test the content of the $imported-tree variable 
         and copy it into the output tree if it passes   -->
    <xsl:if test="...">
      <xsl:copy-of select="$imported-tree" />
    </xsl:if>
  </xsl:template>

I don't know what kind of things you want to do to the result of
transforming the imported document, but using the node-set extension
function you could even process *that* in order to get a refined version,
as many times as you want.

Is that kind of what you're after?

Cheers,

Jeni

Jeni Tennison
http://www.jenitennison.com/




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.