473,898 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding to DocBook DTD

Hi,

I have an element that I would like to add to the docbook DTD. This
element is a wrapper element that I would like to wrap all of the
standard docbook elements. This element is called "changebar" . So
for example I would like changebar to appear like:

<changebar>
<chapter>
.........
</chapter>
</changebar>

<changebar>
<orderedlist>
.........
</orderedlist>
</changebar>

<changebar>
<para>
.........
</para>
</changebar>

Does anyone know how I can do that in the docbook DTD?

Thanks

May 24 '07 #1
11 1815
STRONG suggestion that a much easier thing to do would be to add a
changed="yes" attribute to elements you want to mark this way. That can
be done without altering the DTD, since additional attributes are
treated as annotations and ignored by DTD validation. And in fact that's
the right approach in any case; change flags *ARE* annotations rather
than being part of the document's semantics, and really should be
handled as attributes rather than as element structure even if they were
going to become an official part of DocBook.

To make it really useful, I woudl suggest taking it a step further to
changeversion=" 3.2" or changedate="200 70524" -- so a processor can
report what has changed since a particular point in time, or render
nested changebars (which is something IBM's SCRIPT/DCF system was able
to do, though it was working on SGML markup rather than XML).

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
May 24 '07 #2
Thank you for your reply.

Our team had went over the idea of using a changebar attribute. But
the reason we decided to use an element is because we would like to
conditionalize the changebar according to the different countries our
manuals will be sent out to. So in the end it was decided a changebar
element with country attributes are the way to go. There are other
reasons as well and also it would be nice to know how to add elements
to every level of a document. Any suggestions?

Thanks
May 24 '07 #3
conditionalize the changebar according to the different countries our
manuals will be sent out to. So in the end it was decided a changebar
element with country attributes are the way to go.
Could be done with a changebar attribute having country flags in its values.
also it would be nice to know how to add elements
to every level of a document.
Can't be done without major changes to the DTD unless the DTD already
provides a mechanism for it using Parameter Entities or something of
that sort. And even if the hooks are there, doing this risks losing the
ability to exchange these documents with other users/tools working in
Docbook unless they too are prepared to accept unexpected elements and
make some assumptions about exactly how to attempt to work past them.

Ignoring additional attributes really is a lot easier than ignoring
additional structure.

So my suggestion is "It's going to hurt when you do that." If you don't
like that suggestion, all I can suggest is digging into the DocBook DTDs
to see whether they do have the hooks for this, or if you're going to
have to patch them to death to make this work... and digging into all
your tools to see whether they'll support it or will blow up in your face.
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
May 24 '07 #4
The other solution would be to create Processing Instructions for
start-change-bar and end-change-bar. (Or, for somewhat less chaos,
start-change-bar-on-next-element). Structurally ugly, but PIs are not
validated; they're directives/hints to specific applications and apps
which don't care about them are supposed to ignore them.

By the way, this question of "how do I extend a language" is precisely
why namespaces and schemas were introduced. If you're really going to
need this capability, I'd suggest dumping DTDs and moving over.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
May 24 '07 #5
In article <4655e8fa$1@kcn ews01>,
Joseph Kesselman <ke************ @comcast.netwro te:
>STRONG suggestion that a much easier thing to do would be to add a
changed="yes " attribute to elements you want to mark this way. That can
be done without altering the DTD, since additional attributes are
treated as annotations and ignored by DTD validation.
I'm baffled by this comment. All attributes must be declared for DTD
validity.

-- Richard
--
"Considerat ion shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
May 24 '07 #6
Thanks again for your replies. I know attributes and processing
instructions will make things easier. And switcing away from DTDs
would be great too, but we really can't do that with the system we are
using. We are so deep within it it would mean changing 200 manuals of
Docbook DTD related content.

Anyways, I know how to get it so that changbar elements can wrap a
para. These two lines of code will do it:

<!ENTITY % local.indexdivc omponent.mix "|changebar ">
<!ENTITY % local.list.clas s "|changebar ">

But in terms of wrapping chapters, sections, lists, etc, I am still
having no luck. Any further sugggestions?

May 24 '07 #7
Richard Tobin wrote:
I'm baffled by this comment. All attributes must be declared for DTD
validity.
Darn. You're right; I slipped a gear somehow. Either I was thinking of
one of the "lazy" partial evaluation modes some parsers offer, or I was
confusing it with something else...
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 25 '07 #8
pa**********@gm ail.com wrote:
Anyways, I know how to get it so that changbar elements can wrap a
para. These two lines of code will do it:

<!ENTITY % local.indexdivc omponent.mix "|changebar ">
<!ENTITY % local.list.clas s "|changebar ">

But in terms of wrapping chapters, sections, lists, etc, I am still
having no luck. Any further sugggestions?
Unless there's a similar entity defining a list of children which you
can add changebar to, no suggestions. I'm afraid I'm not willing to
grovel through the DocBook DTD to try to resolve this for you, not on a
volunteer basis anyway.

Note too that unless changebar itself limits its contents, you risk
opening up the DTD much more than just adding the wrapper. Which is
another reason I think you're heading down a blind alley with this
solution. But de gustibus...

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 25 '07 #9
pa**********@gm ail.com wrote:
Hi,

I have an element that I would like to add to the docbook DTD. This
element is a wrapper element that I would like to wrap all of the
standard docbook elements. This element is called "changebar" . So
for example I would like changebar to appear like:

<changebar>
<chapter>
.........
</chapter>
</changebar>

<changebar>
<orderedlist>
.........
</orderedlist>
</changebar>

<changebar>
<para>
.........
</para>
</changebar>

Does anyone know how I can do that in the docbook DTD?

Thanks
What would the content model of the changebar element look like? And
what would the content model of all other elements look like?

Introducing an element that can be used anywhere and contain anything
makes validation rather pointless. Much better to use attributes or PIs,
like others have suggested.

// Magnus
May 25 '07 #10

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

Similar topics

3
2729
by: Dr. Laurence Leff | last post by:
I am having trouble doing the basics with xmlto on Redhat to convert DocBook XML into the various files. I believe the problem is the first line on the files: Here is starter file (notes.xml): <!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"> <!ENTITY chap1 SYSTEM "chap1.xml"> <Book><title>CS310 notes</title></BOOK>
2
2771
by: Simon Strandgaard | last post by:
I am trying to understand how to create a 'catalog.xml' file for my docbook-xml documents. If I understand correct a local catalog.xml file can both avoid hardcoding in makefiles (portability), plus speed up if the stylesheet+dtds is located on the local machine. Question #1: How do I create a catagory.xml file, which works?
1
1640
by: Carlo | last post by:
I was wondering if someone could help me with this or point me to a good resource. I'm trying to add some attributes to docbook to be used later in effectivity. It was recommended I change the dbpoolx.mod: <!ENTITY % local.common.attrib ""> to <!ENTITY % local.common.attrib
3
4071
by: ZJT | last post by:
What are the ways and corresponding tools to transform a docbook document to a pdf document? Thanks a lot!
0
1061
by: KemperR | last post by:
Dear Experts, I'm new to docbook and have sucessfully started to get into customisation layers. Therefore I changed the dtd as recomended. But I got stuck at the simple point when I want to add existing classes to my new elements. E.g I would like to see every thing of the para.class to my new element eeabastract. Please find my DTD below: My problem is that I can only refer to an existing class after %DocBookDTD is called. But than I...
2
1739
by: Yarco | last post by:
I'm learning for docbook under win32. I download: openjade-1_3_1-2-bin docbook-xml-4.4 docbook-dsssl-1.79 ldp.dsl And then copy all openjade bin\ to win32 system\, and then create a directory share\ under my workhome. Copy openjade-dsssl, docbook-xml-4.4, docbook-dsssl-1.79 to share\. ldp.dsl into docbook-dsssl-1.79\html\.
7
8113
by: mike p. | last post by:
I have a docbook xml file, and am using standard docbook 1.61.3 xsl stylesheets to do xhtml transform. Transform works fine when using MSXML. When I try to do the following using asp.net 1.1: private void Page_Load(object sender, System.EventArgs e) { // load content XslTransform trans = new XslTransform();
3
2162
by: Otmar Ganahl | last post by:
Hi! In my application I transform a docbook file to a html view using the webcontrol "Xml" (with a xsl).It works fine, except the using of the tag "fileref" in the docbook-file will cause an exception: _ctl1_DesktopThreePanes1_ThreePanes__ctl3_xml1: Failed! Object reference not set to an instance of an object. (The IE6.0 xml-parser transform the docbook file
2
3354
by: Joseph Kesselman | last post by:
Since the recent "Docbook on Windows" question brought this up... I did a bit of checking on the current status of these schemas, what they're intended for and how they interrelate. IBM's Robert Weir reports that there have been "some discussions in OASIS, between the ODF, DocBook and DITA TC's to come up with a positioning and interop story involving these three standards, with the intent of giving a demo at an OASIS symposium next...
0
11259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10948
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10483
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9661
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8035
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5880
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4706
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4295
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.