| Subject: [xsl] Ancestors and Imported docs From: "Eric Schenfeld" <ESchenfeld@xxxxxxxxxxx> Date: Wed, 01 Aug 2001 13:50:26 -0400 | 
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()<$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 | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| RE: [xsl] fixed position, Wendell Piez | Thread | Re: [xsl] Ancestors and Imported do, Wendell Piez | 
| Re: [xsl] xsl:for-each and xsl:appl, Michael Case | Date | Re: [xsl] xsl:for-each and xsl:appl, David Carlisle | 
| Month |