Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > DTD entity reference resolve

Reply
Thread Tools

DTD entity reference resolve

 
 
Per
Guest
Posts: n/a
 
      02-03-2004
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?
 
Reply With Quote
 
 
 
 
Paul A. Hoadley
Guest
Posts: n/a
 
      02-03-2004
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.

mailtoaulh_logicsquad_net (make the obvious substitutions)
 
Reply With Quote
 
 
 
 
Per
Guest
Posts: n/a
 
      02-03-2004
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
 
Reply With Quote
 
Paul A. Hoadley
Guest
Posts: n/a
 
      02-04-2004
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.

mailtoaulh_logicsquad_net (make the obvious substitutions)
 
Reply With Quote
 
Per
Guest
Posts: n/a
 
      02-04-2004
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entity, problem with entity key ThatsIT.net.au ASP .Net 1 09-07-2009 02:20 AM
Entity Framework - Reassigning child entity's parent Norm ASP .Net 3 07-06-2009 07:28 PM
How to relate a SQL based entity with an Object based entity in Entity Framework markla ASP .Net 1 10-06-2008 09:42 AM
src-resolve: Cannot resolve the name ... ivanet@gmail.com XML 1 03-23-2007 12:10 PM
Entity Name or Entity Number? Samuel van Laere HTML 4 02-24-2007 10:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57