DTD entity reference resolve

Discussion in 'XML' started by Per, Feb 3, 2004.

  1. Per

    Per Guest

    Hi,

    I'm struggling with the DocBook XML DTD, which can be found at
    http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd.

    But this DTD seems to somehow include some other documents. E.g.:

    <!ENTITY % dbhier.module "INCLUDE">
    <![ %dbhier.module; [
    <!ENTITY % dbhier PUBLIC
    "-//OASIS//ELEMENTS DocBook Document Hierarchy V4.2//EN"
    "dbhierx.mod">
    %dbhier;
    ]]>

    But my editor seems to not support this. So, it (the editor) is not
    able to show me popup/editing help, as it does not know the entities
    of the DTD (as they are included).

    Is this correct?

    Is there a way to easily produce one big DTD, with all the included
    DTD files inside?

    Or is there a good editor, which supports this format of DTDs?
     
    Per, Feb 3, 2004
    #1
    1. Advertising

  2. On 2 Feb 2004 16:37:29 -0800, Per <> wrote:

    > But my editor seems to not support this. So, it (the editor) is not
    > able to show me popup/editing help, as it does not know the entities
    > of the DTD (as they are included).


    What editor are you using? It really should be able to handle this.

    > Is there a way to easily produce one big DTD, with all the included
    > DTD files inside?


    Simplified DocBook is distributed with a flattened DTD, but if you
    need the full DocBook DTD, you could try Norm Walsh's 'flatten' perl
    script:

    http://nwalsh.com/perl/flatten/index.html

    > Or is there a good editor, which supports this format of DTDs?


    There sure is: emacs with either PSGML or nxml-mode.

    (As always, faster and better DocBook answers are available from the
    mailing lists:)

    http://docbook.org/mailinglist/index.html


    --
    Paul.

    mailto:paulh_logicsquad_net (make the obvious substitutions)
     
    Paul A. Hoadley, Feb 3, 2004
    #2
    1. Advertising

  3. Per

    Per Guest

    Hi Paul,

    Thank you very much for your helpfull response.

    > What editor are you using? It really should be able to handle this.


    I'm using IntelliJ IDEA development environment. Its primary focus is
    Java development but it has an XML mode too.

    Uhm, but maybe I'm using the DTD incorrectly? Inside one of the
    included DTD modules, it says this:

    In DTD driver files referring to this module, please use an
    entity
    declaration that uses the public identifier shown below:

    <!ENTITY % dbnotn PUBLIC
    "-//OASIS//ENTITIES DocBook XML Notations V4.1.2//EN"
    "dbnotnx.mod">
    %dbnotn;

    Seems like the docbook DTDs are made such that I can customize the use
    of docbook. This I get from this text in the main DTD:

    For example, if your document's top-level element is Book, and
    you are using DocBook directly, use the FPI in the DOCTYPE
    declaration:

    <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
    [...]>

    Or, if you have a higher-level driver file that customizes
    DocBook,
    use the FPI in the parameter entity declaration:

    <!ENTITY % DocBookDTD PUBLIC "-//OASIS//DTD DocBook XML
    V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
    %DocBookDTD;

    But in my docbook source, I simply have this simple DOCTYPE in the
    top:

    <?xml version='1.0'?>
    <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

    Can (or should) I specificly import the DTD modules, maybe by chosing
    between only some, if I only need some!?

    > Simplified DocBook is distributed with a flattened DTD, but if you
    > need the full DocBook DTD, you could try Norm Walsh's 'flatten' perl
    > script:
    >
    > http://nwalsh.com/perl/flatten/index.html


    Thanks. Had a go on it, and after hacking a bit, I got it to eat the
    4.1.2 docbook dtds. So now I have a flattened version. And it works in
    my editor.
    Great!

    > > Or is there a good editor, which supports this format of DTDs?

    >
    > There sure is: emacs with either PSGML or nxml-mode.


    Oh yeah emacs. Maybe I will go back to using emacs for docbook edit.
    Seems like I always come back to that great editor :)

    Regards, Per
     
    Per, Feb 3, 2004
    #3
  4. Hi Per,

    On 3 Feb 2004 12:34:44 -0800, Per <> wrote:

    > Uhm, but maybe I'm using the DTD incorrectly?


    I don't know anything about your editor, but you want to direct it at
    'docbookx.dtd' by whatever mechanism it supports. This is most likely
    a SYSTEM entry in the DOCTYPE. You've used a URL here:

    > <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    > "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
    > [...]>


    which is fine, but your editor may not be able to retrieve that. You
    may want to just point it to where 'docbookx.dtd' is on your local
    filesystem.

    > Can (or should) I specificly import the DTD modules, maybe by
    > chosing between only some, if I only need some!?


    You're absolutely right in that DocBook's DTD is organised in a
    modular fashion to allow for customising, but to just edit with the
    standard DTD, you shouldn't need to do anything more than point your
    editor at the top-level file, 'docbookx.dtd'.

    >> http://nwalsh.com/perl/flatten/index.html

    >
    > Thanks. Had a go on it, and after hacking a bit, I got it to eat the
    > 4.1.2 docbook dtds. So now I have a flattened version. And it works
    > in my editor. Great!


    Well done. Can you put the flattened version on the web somewhere?

    > Oh yeah emacs. Maybe I will go back to using emacs for docbook edit.
    > Seems like I always come back to that great editor :)


    :)


    --
    Paul.

    mailto:paulh_logicsquad_net (make the obvious substitutions)
     
    Paul A. Hoadley, Feb 4, 2004
    #4
  5. Per

    Per Guest

    > I don't know anything about your editor, but you want to direct it at
    > 'docbookx.dtd' by whatever mechanism it supports. This is most likely
    > a SYSTEM entry in the DOCTYPE. You've used a URL here:
    >
    >

    [SNIP]
    > which is fine, but your editor may not be able to retrieve that. You
    > may want to just point it to where 'docbookx.dtd' is on your local
    > filesystem.


    It can get them from URLs. Have worked fine with other DTDs. Think I
    will give them a bugreport at JetBrains (the makers of IDEA). They
    tend to listen :)

    And then I will go right at getting it to work with Emacs. I guess it
    can do it without a flattened version?

    > >
    > > Thanks. Had a go on it, and after hacking a bit, I got it to eat the
    > > 4.1.2 docbook dtds. So now I have a flattened version. And it works
    > > in my editor. Great!

    >
    > Well done. Can you put the flattened version on the web somewhere?


    I do not have somewhere I can put it myself. But I will give it away
    to someone who has. But will it be "legal" to publish it outside the
    OASIS? Haven't had a look at the license.
     
    Per, Feb 4, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,645
    Jukka K. Korpela
    Feb 24, 2007
  2. Replies:
    1
    Views:
    10,177
  3. markla
    Replies:
    1
    Views:
    552
    Steven Cheng
    Oct 6, 2008
  4. Norm
    Replies:
    3
    Views:
    2,734
  5. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,202
    ThatsIT.net.au
    Sep 7, 2009
Loading...

Share This Page