Re: [docbook-apps] add 'id' afterwards automatically

From
Dave Pawson <>
Date
2003-10-14T18:50:42+00:00
ID
Thread
Re: [docbook-apps] add 'id' afterwards automatically
At 16:53 14/10/2003 +0500, David Tolpin wrote:
> > Is there an easy way to process existing DocBook XML files and add to all
> > elements an "id" attribute which do not already have one?
> >
>
>I would do it in Java in two passes.


... or an identity pass,

<xsl:template name="addId">
<xsl:when test="@id">
    copy through
<xsl:otherwise>
    attribute name='id'
      generate-id()
    /attribute
</xsl:otherwise>

then call this from all node()'s?

HTH DaveP