Re: [docbook] DocBook RNG Schema vs DocBook DTD

From
Giuseppe Greco <>
Date
2007-10-26T09:25:03+00:00
ID
Thread
Re: [docbook] DocBook RNG Schema vs DocBook DTD
Tom,

Thanks... and what's about elements that contain fixed text...

<grammar xmlns:db="http://docbook.org/ns/docbook"
    ns="http://docbook.org/ns/docbook"
    xmlns="http://relaxng.org/ns/structure/1.0">
    <include href="docbook/rng/docbook.rng"/>

    <element name="corpshortname" type="token" fixed="Agamura"/>
    <element name="corplongname" type="token" fixed="Agamura, Inc"/>
    ...
</grammar>

... and then use them like this?

<para>
    <corpshortname/> and the <corpshortname/> logo are trademarks of
    <corplongname/> All other names are trademarks of their respective
    owners.
</para>

Furthermore, I don't want to put entity values directly into the
documents - that's why I put those common entities into the DTD
(I use to store DTDs and stylesheets on a server so writing documents
does not require a local copy of DocBook and its extensions).

> Hi Giuseppe,
>
>> After a few years I'm back to DocBook... and as the first step I should
>> port all my stuff to DocBook "Relax NG" edition.
>>
>> In the past I customized the DocBook DTD V4.1 by defining some common
>> entities (e.g. corp. name, corp. website, etc.) in order to generate
>> consistent documentation. In the customized DTD I added the following
>> entities:
>>
>> <!ENTITY corp.shortname "Agamura">
>>  ...
>
> You can also use entities in DocBook 5 like this:
>
> ------------------------
> <?xml version="1.0"?>
> <!DOCTYPE article
> [
>   <!ENTITY corp.shortname "Agamura">
>   <!-- Include your definitions here -->
> ]>
> <article xmlns="http://docbook.org/ns/docbook"
>       xml:lang="&language;"
>       xml:id="CSharpCodingGuidelines" >
>   <!-- -->
> </article>
> ------------------------
>
>> Then, in my documents I used them as follows:
>>
>> <!DOCTYPE article PUBLIC "-//AGAMURA//DTD DocBook V4.1 Extension//EN"
>>     "http://www.agamura.com/quxo/dtd/1.0/docbookx.dtd" [
>>     <!ENTITY introduction SYSTEM "Introduction.xml">
>>     ...
>> ]>
>> <article id="CSharpCodingGuidelines" lang="&language;">
>> [...]
>>     </articleinfo>
>>
>>     &introduction;
>>     ...
>> </article>
>>
>> In the XML above, entity &legalnotice; contains the following:
>
> Use XInclude in this case: <xi:include href="legalnotice.xml"/>
>
>
>> [...]
>> ... now the question is: how can I achieve the same with the Relax NG
>> schema?
>
> See the Transition Guide for further information:
>
>   http://www.docbook.org/docs/howto/
>
> Most questions are answered there. :-)
>
> Hope that helps,
> Tom
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
>


----------------------------------------
Giuseppe Greco

Agamura Entertainments, Inc.
6928 Manno
Switzerland

call giuseppe.greco via Skype
phone:  +41 (0)91 604 67 65
mobile: +41 (0)79 590 33 06
email:  
----------------------------------------