473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DTD entity reference resolve

Per
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?
Jul 20 '05 #1
4 1962
On 2 Feb 2004 16:37:29 -0800, Per <IM**********@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)
Jul 20 '05 #2
Per
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
Jul 20 '05 #3
Hi Per,

On 3 Feb 2004 12:34:44 -0800, Per <IM**********@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)
Jul 20 '05 #4
Per
> 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.
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Vincent Lefevre | last post by:
I would like to know if the base URI considered to resolve an unparsed entity defined by a relative URI should be the URI before or after its rewriting due to a possible catalog. Let's take an...
2
by: Ed Dennison | last post by:
I'm starting to look at DocBook-XML (not SGML) for producing a large documentation set. The hierarchy of DocBook elements for organizing the content is (more or less); set book part chapter...
11
by: Douglas Reith | last post by:
Hi There, Can someone please tell me why the XML spec states that an attribute value with an external entity is forbidden? Or point me to the appropriate document? Or better still, perhaps you...
3
by: cochrane68 | last post by:
I'm trying to access an XML snippet based on the classpath. I know how to use a snippet based on the absolute path of a file using: <!DOCTYPE project > However, this is going to be used as...
4
by: Erwin Gabler | last post by:
Trying to validate a document with a reference to a DTD ("PUBLIC" identifier): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE systems-description PUBLIC "-//foo/nono" ""> .... The DTD uses...
6
by: Tuomas Rannikko | last post by:
Hello, I'm currently writing a XML processor for the fun of it. There is something I don't understand in the spec though. I'm obviously missing something important. The spec states that both...
0
by: punjabinezzie | last post by:
I am developing an Application which currently has two XML files. One XML file with some nodes and an external entity reference to another XML file. The source XML file is being parsed using Xerces...
11
by: Jean-François Michaud | last post by:
Hello all, I'm having a little problem, The UTF-8 parser we are using converts the newline entity ( ) within an attribute that we are using to paliate CSS limitations. After the parser has...
0
by: zman77 | last post by:
Hi. My solution (working in VS 2008) has a C# console app, and a C# web service. The service has an entity data model. It has numerous stored procedures. For one of the stored procs, which just...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.