This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Ancestors and Imported docs


Sorry if anyone gets this twice but i was having some e-mail problems

---------------------------------------------------------

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]