Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   DTD entity reference resolve (http://www.velocityreviews.com/forums/t166547-dtd-entity-reference-resolve.html)

Per 02-03-2004 12:37 AM

DTD entity reference resolve
 
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?

Paul A. Hoadley 02-03-2004 04:01 AM

Re: DTD entity reference resolve
 
On 2 Feb 2004 16:37:29 -0800, Per <IMJLMJKOIMYR@spammotel.com> 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)

Per 02-03-2004 08:34 PM

Re: DTD entity reference resolve
 
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

Paul A. Hoadley 02-04-2004 10:19 AM

Re: DTD entity reference resolve
 
Hi Per,

On 3 Feb 2004 12:34:44 -0800, Per <IMJLMJKOIMYR@spammotel.com> 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)

Per 02-04-2004 07:43 PM

Re: DTD entity reference resolve
 
> 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.


All times are GMT. The time now is 05:52 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.