[xml2rfc] Re: Including ENTITIES

bortzmeyer at nic.fr (Stephane Bortzmeyer) Tue, 09 May 2006 00:51 UTC

From: bortzmeyer at nic.fr (Stephane Bortzmeyer)
Date: Tue, 09 May 2006 00:51:02 +0000
Subject: [xml2rfc] Re: Including ENTITIES
In-Reply-To: <ed6d469d0604271053v502d7d49u3aebc079510ad6de@mail.gmail.com>
References: <026001c66972$b9247400$0400a8c0@china.huawei.com> <20060427120327.GA5141@nic.fr> <ed6d469d0604271053v502d7d49u3aebc079510ad6de@mail.gmail.com>
Message-ID: <20060509075045.GA10000@nic.fr>
X-Date: Tue May 9 00:51:02 2006

On Thu, Apr 27, 2006 at 10:53:51AM -0700,
 Bill Fenner <fenner@gmail.com> wrote 
 a message of 31 lines which said:

> Only works if your MIB happens to be valid CharData.

If it is a problem, just escape the MIB before insertion, something
which is easy to automatize:

% xmlstarlet esc < mib.txt > mib_escaped.txt
% xmllint --noent with-entities.xml

xmlstartlet is at http://xmlstar.sourceforge.net/

> My obvious suggestion is to postprocess mib.txt into mib.xml by
> escaping problem characters and use a parsed entity inclusion, but
> that's an external step and I think David wanted to avoid that.

make (or a competitor like scons) is here for that:

rfc.xml: with-entities.xml mib_escaped.txt
        xmllint --noent with-entities.xml > $@

mib_escaped.txt: mib.txt
        xmlstarlet esc < mib.txt > $@

and you just type "make rfc.xml". Difficult to be simpler.
>From dbharrington at comcast.net  Tue May  9 12:02:31 2006
From: dbharrington at comcast.net (David B Harrington)
Date: Tue May  9 08:03:22 2006
Subject: [xml2rfc] RE: Including ENTITIES
In-Reply-To: <20060509075045.GA10000@nic.fr>
Message-ID: <019801c67379$99e16380$0400a8c0@china.huawei.com>

Hi,

I will keep your suggestions in mind.

However, I am trying to develop a template that is valid XML and will
be accepted by any XML editor available.

I do not consider it acceptable to write a template that requires
preprocessing through multiple utilities, and that requires a MIB
document writer to install XXE plus the xml2rfc plugin to XXE plus
xmllint plus xmlstartlet plus make and a C compiler and libxml2 and
libxslt and a *NIX operating system. Not everybody works in that type
of environment.

I think that would defeat the purpose of writing the template - to
make it simpler for all MIB writers to write a MIB document using
xml2rfc.

dbh

> -----Original Message-----
> From: Stephane Bortzmeyer [mailto:bortzmeyer@nic.fr] 
> Sent: Tuesday, May 09, 2006 3:51 AM
> To: Bill Fenner
> Cc: Stephane Bortzmeyer; David B Harrington; xml2rfc mailing list
> Subject: Re: Including ENTITIES
> 
> 
> On Thu, Apr 27, 2006 at 10:53:51AM -0700,
>  Bill Fenner <fenner@gmail.com> wrote 
>  a message of 31 lines which said:
> 
> > Only works if your MIB happens to be valid CharData.
> 
> If it is a problem, just escape the MIB before insertion, something
> which is easy to automatize:
> 
> % xmlstarlet esc < mib.txt > mib_escaped.txt
> % xmllint --noent with-entities.xml
> 
> xmlstartlet is at http://xmlstar.sourceforge.net/
> 
> > My obvious suggestion is to postprocess mib.txt into mib.xml by
> > escaping problem characters and use a parsed entity inclusion, but
> > that's an external step and I think David wanted to avoid that.
> 
> make (or a competitor like scons) is here for that:
> 
> rfc.xml: with-entities.xml mib_escaped.txt
>         xmllint --noent with-entities.xml > $@
> 
> mib_escaped.txt: mib.txt
>         xmlstarlet esc < mib.txt > $@
> 
> and you just type "make rfc.xml". Difficult to be simpler.
>