This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] add 'id' afterwards automatically
- From: David Tolpin <dvd at davidashen dot net>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Wed, 15 Oct 2003 13:18:56 +0500 (AMST)
- Subject: Re: [docbook-apps] add 'id' afterwards automatically
> David Tolpin wrote:
>
> > Here is one that will.
>
> One remaining problem:
>
> The DOCTPE declaration of the original soruce file does not get copied to
> resulting output file.
>
> Any hints?
:-) I would do it in Perl. I would first copy DOCTYPE declaration from the source
to the target, then use the stylesheet as long as you are happy with it to append
the results sans the first line (xml declaration) to the target file.
I would stop inserting DOCTYPE declaration on the first xml element.
perl -e 'while(<STDIN>) {/^\s*\<\w/ and last; print;}' < source.xml > target.xml
will get the xml declaration and the DTD.
xslt source.xml addid.xsl | tail +1 >> target.xml
will add the data.
David Tolpin
http://davidashen.net/
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.