[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] can dtds be extended?
- From: Wayne Steele <xmlmaster@hotmail.com>
- To: mbrown@insightful.com, xml-dev@lists.xml.org
- Date: Wed, 12 Sep 2001 13:27:25 -0700
Kinda Sorta.
You'll have to use an "Internal Subset" to do this.
Here's an example:
---standard.dtd---
<!ELEMENT E (#PCDATA)* >
<!ATTLIST E
a CDATA #REQUIRED >
------------------
Now say you wanted to include or inherit this DTD, but add a 'b' attribute
on the 'E' element. Your instance document might look like:
---------------------
<?xml version="1.0" ?>
<!DOCTYPE E SYSTEM "standard.dtd" [
<!ATTLIST E b CDATA #IMPLIED >
]>
<E
a="i am a required attribute"
b="I am an new attribute
/>
---------------------
If things end up getting too complicated, you can use External Parameter
Entities to do much the same thing, and more.
-Wayne Steele
>From: Matt Brown <mbrown@insightful.com>
>Reply-To: mbrown@insightful.com
>To: xml-dev@lists.xml.org
>Subject: [xml-dev] can dtds be extended?
>Date: Wed, 12 Sep 2001 12:02:13 -0700
>
>Hi,
>I am using a published DTD (PMML) and need to add attributes to one of the
>elements. Is there any way I can do this, ie, extend the DTD in a way such
>that I can include extra information for my needs while still conforming to
>the published standard? For example, is there any way I can overwrite an
>element or attlist in an xml doc with a new one of the same name with more
>attributes? Can I reference 2 DTD's an include a smaller "DTD addition"
>with
>my xml? Is there any way to support inheritance in XML?
>thanks,
>matt
>
>
>-----------------------------------------------------------------
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To subscribe or unsubscribe from this elist use the subscription
>manager: <http://lists.xml.org/ob/adm.pl>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp