You might also investigate the XML-related Perl modules at CPAN. They are
probably in better shape.
Bob Stayton
Sagehill Enterprises
b...@sagehill.net
--------------------------------------------------
From: "Shlomi Fish" <shlo...@shlomifish.org>
Sent: Monday, November 26, 2012 1:14 AM
To: "Bob Stayton" <b...@sagehill.net>
Cc: <docbook-apps@lists.oasis-open.org>
Subject: Re: [docbook-apps] How to programmatically get a list of elements
of DocBook 4 and DocBook 5?
Hi Bob,
On Sun, 25 Nov 2012 09:29:17 -0800
"Bob Stayton" <b...@sagehill.net> wrote:
Hi Shlomi,
If you don't mind working in Perl, my LiveDTD Perl program parses a DTD
and
creates a @ELEMENT array that includes all the active element names. You
could use part of that program to generate your list. It is available
for
free from here:
http://www.sagehill.net/livedtd/
I see. Well, I don't mind working with Perl, as my code there is already
in
Perl and Bash, and I've worked with Perl since 1996.
However, I do wish there was an easier way to introspect the DTD than
tweaking the code of a monolithic program, which suffers from many bad
programming habits:
* http://perl-begin.org/tutorials/bad-elements/ (my link)
* http://www.slideshare.net/thaljef/cpan-for-private-code
*
http://www.theopensourceway.org/book/The_Open_Source_Way-How_to_tell_if_a_FLOSS_project_is_doomed_to_FAIL.html
BTW, what is the licence of this code? The first paragraph is similar to
the
MIT/X11 licence (see http://en.wikipedia.org/wiki/MIT_License ) but it has
some
other paragraphs following it.
Regards,
Shlomi Fish
Bob Stayton
Sagehill Enterprises
b...@sagehill.net
--------------------------------------------------
From: "Shlomi Fish" <shlo...@shlomifish.org>
Sent: Saturday, November 24, 2012 11:32 PM
To: <docbook-apps@lists.oasis-open.org>
Subject: [docbook-apps] How to programmatically get a list of elements of
DocBook 4 and DocBook 5?
> Hi all,
>
> here:
>
> https://bitbucket.org/shlomif/vim-docbook-5-support
>
> I have a repository where I am trying to get a machine readable list of
> DocBook
> 4 and DocBook 5 elements. What I have done of parsing the DocBook 5's
> RNG
> appears to work fine, but I'm having trouble with parsing the DocBook 4
> RNGs
> from
> http://www.docbook.org/rng/4.5/ and some elements, suck as <ulink />
> are
> missing. Should I just parse and extract <element name=..."> from all
> the
> RNG
> fragments and then concatenate them and remove duplicates? Or is there
> a
> better
> way?
>
> I tried to find a way to extract this information out of the DocBook
> 4.x
> DTD,
> but could not find a DTD parser that allowed for introspection.
>
> Regards,
>
> Shlomi Fish
>
> --
> -----------------------------------------------------------------
> Shlomi Fish http://www.shlomifish.org/
> First stop for Perl beginners - http://perl-begin.org/
>
> Chuck Norris can read Perl code that was RSA encrypted.
>
> Please reply to list if it's a mailing list post -
> http://shlom.in/reply .
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
>
>
>
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
First stop for Perl beginners - http://perl-begin.org/
<Botje> Khisanth =~ s/must sleep/must give Botje all my money/ .
— Freenode’s #perl
Please reply to list if it's a mailing list post - http://shlom.in/reply .
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org