[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] not a well-formed output XML


Subject: RE: [xsl] not a well-formed output XML
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Wed, 2 Mar 2005 14:06:52 +0200

Hi,

>  Im really tired of trying to make my XML document
> well-formed as well
> as enable recursive looping until no more 'children' or
> 'implications'
> of a particular element are found, so would appreciate any help. The
> output that I receive is correct (it does all the right
> extraction) though.

  <xsl:template match="SubConcepts">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:for-each select="descendant::SubConcept">
        <xsl:copy>
          <xsl:apply-templates select="@*"/>
          <xsl:apply-templates select="*[1]" mode="walker"/>
        </xsl:copy>
      </xsl:for-each>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="Value | ChildConcept" mode="walker">
    <xsl:apply-templates select="."/>
    <xsl:apply-templates select="following-sibling::*" mode="walker"/>
  </xsl:template>
  <xsl:template match="*" mode="walker">
    <xsl:apply-templates select="following-sibling::*" mode="walker"/>
  </xsl:template>
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

Donno what that grouping method is called, but it's one of the ones that you
encounter if you search the list archives.

Cheers,

Jarno - Madam Zu: September 2002 Mix


Current Thread
Keywords
xml