xsl-list
[Top] [All Lists]

RE: This could be simple, but not for me!

2004-05-25 12:34:38
-----Original Message-----
From: Andreas L. Delmelle [mailto:a_l(_dot_)delmelle(_at_)pandora(_dot_)be]


Hi,

Reconsidering this, I would move the xsl:if out of the Name template, and
the enclosed xsl:value-of into the City template...

So, instead of:
<xsl:template match="City">
  <xsl:param name="pNo" />
  <xsl:apply-templates select="following-sibling::A/B/Name[
                         following::Info[1]/Detail/@no=$pNo]" />
</xsl:template>

<xsl:template match="Name">
  <xsl:if test="position()=1">
    <xsl:value-of select="concat('&#x0A;&#x09;',
                    ancestor::Community/City)" />
  </xsl:if>
  <xsl:value-of select="concat('&#x0A;&#x09;&#x09;',.)" />
</xsl:template>


I'd make it:
<xsl:template match="City">
  <xsl:param name="pNo" />
  <xsl:value-of select="concat('&#x0A;&#x09;',.)" />
  <xsl:apply-templates select="following-sibling::A/B/Name[
                         following::Info[1]/Detail/@no=$pNo]" />
</xsl:template>

<xsl:template match="Name">
  <xsl:value-of select="concat('&#x0A;&#x09;&#x09;',.)" />
</xsl:template>


Greetz,

Andreas