This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > February 2005 > extend existing dtd





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author extend existing dtd
Andreas

2005-02-14, 4:22 am

Hi guys,

I am fairly new to XML, so please forgive me if this questions is really
simple:

is there a possibility to extend existing DTDs? I would like to base my XML
DTD on the existing http://www.w3.org/TR/html4/loose.dtd, but I want to add
a few more elements. Is that possible to do and if so, what would be the
easiest way to do it? I mean, without cutting and pasting the entire W3 DTD
into my own file?

Thanks heaps!


Martin Honnen

2005-02-14, 6:36 pm



Andreas wrote:


> is there a possibility to extend existing DTDs? I would like to base my XML
> DTD on the existing http://www.w3.org/TR/html4/loose.dtd, but I want to add
> a few more elements. Is that possible to do and if so, what would be the
> easiest way to do it? I mean, without cutting and pasting the entire W3 DTD
> into my own file?


The HTML 4 DTD is not an XML DTD but an SGML DTD so don't try to use
that DTD if you want to deal with XML. If you are interested in SGML
then try an appropriate group.
As for extending or modularizing XML DTDs, yes, that is possible, the
W3C has done that for XHTML, see
<http://www.w3.org/TR/xhtml-modularization>
for modules and
<http://www.w3.org/TR/xhtml11>
<http://www.w3.org/TR/xhtml-basic>
for examples defining a certain document type based on selected modules.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Andreas

2005-02-14, 11:17 pm

"Martin Honnen" <mahotrash@yahoo.de> wrote in message
news:e$ftgwrEFHA.2568@TK2MSFTNGP10.phx.gbl...
>
>
> Andreas wrote:
>
>
XML[color=darkred]
add[color=darkred]
DTD[color=darkred]
>
> The HTML 4 DTD is not an XML DTD but an SGML DTD so don't try to use
> that DTD if you want to deal with XML. If you are interested in SGML
> then try an appropriate group.
> As for extending or modularizing XML DTDs, yes, that is possible, the
> W3C has done that for XHTML, see
> <http://www.w3.org/TR/xhtml-modularization>
> for modules and
> <http://www.w3.org/TR/xhtml11>
> <http://www.w3.org/TR/xhtml-basic>
> for examples defining a certain document type based on selected modules.


Ah, that sounds like what I was looking for. However, I have read through
most of the documenation but cannot find any examples of how to practically
implement the extension. Perhaps you could help me with this one? I guess
what I am looking for is a simple way to say in a DTD:

1. Import: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
2. Create additional element: <!ELEMENT blah (#PCDATA)>

Sorry if I might be overlooking this info in the links you gave me, but I
just started on XML and find the documentation quite overwhelming.

Cheers.


Soren Kuula

2005-02-15, 7:27 am

Andreas wrote:
> Hi guys,
>
> I am fairly new to XML, so please forgive me if this questions is really
> simple:
>
> is there a possibility to extend existing DTDs? I would like to base my XML
> DTD on the existing http://www.w3.org/TR/html4/loose.dtd, but I want to add
> a few more elements. Is that possible to do and if so, what would be the
> easiest way to do it? I mean, without cutting and pasting the entire W3 DTD
> into my own file?


Internal subsets might work for you ?

<!DOCTYPE foo PUBLIC "..." "..." [
<!ElEMENT my_first_new_element....>
...
]>

<foo>
....
</foo>

But you have to include that into every XML document then,

I think there is no other solution.

Soren

Soren Kuula

2005-02-15, 7:27 am

Andreas wrote:

> Hi guys,
>
> I am fairly new to XML, so please forgive me if this questions is really
> simple:
>
> is there a possibility to extend existing DTDs? I would like to base

my XML
> DTD on the existing http://www.w3.org/TR/html4/loose.dtd, but I want

to add
> a few more elements. Is that possible to do and if so, what would be the
> easiest way to do it? I mean, without cutting and pasting the entire

W3 DTD
> into my own file?



Internal subsets might work for you ?

<!DOCTYPE foo PUBLIC "..." "..." [
<!ElEMENT my_first_new_element....>
...
]>

<foo>
....
</foo>

But you have to include that into every XML document then,

OR look in the thread below, "why does a browser...". Maybe you can
include two external entities?

Soren


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews