[Re: xml from ed]

Matt Graham danceswithcrows@usa.net
27 Jul 2001 12:34:16 EDT


Sean <picasso@madflower.com> wrote:
> On Fri, 27 Jul 2001, Edward Glowacki wrote:
> 
> > \n\n            ---> </para><para>
> > - [text]        ---> <listitem><para>[text]</para></listitem>
> > = [text]        ---> <section><title>[text]</title>
> >                      </section>
> >
> > I wouldn't have to change the way I usually edit files too much
> > to make this system work, since I already do \n\n between
> > paragraphs and use "- text" to denote lists.
> >
> Maybe I am offbase for what you want, but you could just set up a list 
> of aliases for regexp expansion/contraction read from an alias type of 
> file and have perl/python do the macro expansion/contraction.
> Like your alias file would have this for a prototype.
> <li>[text]<\li> = <listitem><para>[text]</para></listitem>
> 
> Your script would read in the alias and could go either way with it with
> a regex substitution. and it wouldnt be so sticky about placement.
> 
> Matter of fact I am surprised there _isnt_ something like this already
> like in the xml standard.

Not in the XML standard per se, but XSL provides a way of transmuting XML into
just about any structured data format you can name.  Of course, XSL is
somewhat opaque, and was generally intended to convert XML into stuff that
isn't XML, but it is standardized and you can use it to do what Ed wants to
do.  Naturally, you can also use sed or Perl or Python to accomplish the same
task, and if I were in this situation I'd hack together a Perl thingy to
convert EdBook into DocBook because XSL can turn into a royal mess.

(Slightly OT:  Did anyone else see the original message and think "XML from
/bin/ed ?  It'd be a royal PITA, but if for some reason you _needed_ it
done....   Of course, now I'm thinking about what executables
/usr/bin/pfaffben or /usr/bin/sean might do, so I should probably shut up.)

-- 
Matt G / Dances With Crows
There is no Darkness in Eternity/But only Light too dim for us to see
"I backed up my brain to tape, but tar says the tape contains no data...."