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

Ancestors and Imported docs

Subject: Ancestors and Imported docs
From: "Eric Schenfeld" <ESchenfeld@xxxxxxxxxxx>
Date: Wed, 01 Aug 2001 13:50:26 -0400
eric schenfeld
I am importing an xml doc 2 times. In one case, i want to format text one way, and another time i want to format text another way. The problem i'm having is that the doc tree doesn't seem to continue over the import.  Does anyone have any ideas?  Thanks.



XML DOC 1:
<!DOCTYPE layout1 [
<!ENTITY navigation SYSTEM "nav.xml">
 ]>

<layout1>
<top_bar>
&navigation;
</top_bar>
<bottom_bar>
&navigation;
</bottom_bar>
</layout1>

nav.xml:
<links>
<link href="Home.shtml">Home</link>
<link href="About.shtml">About Us</link>
</links>

XSL:

<xsl:template match="bottom_bar">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="top_bar">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="links">
  <xsl:if test="top_bar//.">
      <xsl:variable name="color" select="ffffff"/>
  </xsl:if>
  <xsl:if test="bottom_bar//.">
      <xsl:variable name="color" select="000000"/>
  </xsl:if>
  <xsl:variable name="number" select="count(link)"/>
  <xsl:for-each select="link">
    <xsl:if test="position()&lt;$number">
      <a href="{@href}" style="color:#{$color}"><xsl:value-of select="."/></a> | 
    </xsl:if>
    <xsl:if test="position()=$number">
      <a href="{@href}" style="color:#{$color}"><xsl:value-of select="."/></a>
    </xsl:if>
</xsl:for-each>
</xsl:template>


Eric



 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.