[xsl] Usefull?

Subject: [xsl] Usefull?
From: Fernando López Carballeda <fernando@xxxxxxxxx>
Date: Tue, 9 Jan 2001 19:12:46 +0100

I think this cuold be usefull for someone else, basicly only add id to every
element from the XML file an unique ID.

<?xml version='1.0' encoding='ISO-8859-1'?>
     version = "1.0">
  <xsl:output method="xml" encoding="ISO-8859-1" indent="yes" />

  <xsl:template match = "*" >
    <xsl:copy >
      <xsl:apply-templates select = "@*" />
      	   name="id"><xsl:call-template name="object.id"/></xsl:attribute>
      <xsl:apply-templates />

  <xsl:template match = "@*" >
    <xsl:copy />

====================================================================== -->

  <xsl:template name="object.id">
    <xsl:param name="object" select="."/>
      <xsl:when test="$object/@id">
        <xsl:value-of select="$object/@id"/>
        <xsl:value-of select="generate-id($object)"/>


Fernando López Carballeda

PS.- Do not hesitate to correct me.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread