Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [DTD] defining elements depending on attribute

From: Jan Roland Eriksson <jrexon@-------.--->
To: NULL
Date: 12/1/2004 10:42:00 PM
On Wed, 1 Dec 2004 21:57:06 +0100, "Ekim" <the.newsletter@g...>
wrote:

>I wanna create a new DTD for a protocol - therefore I have one question:
>is there a way to define elements depending on a special attribute-value?
>I guess I've confused you so far, so that's what I really mean:
>
>I have got an element "sensor":
><!ELEMENT sensor ((longitude, latitude) | (direction, speed))>
>
>This element has an attribute "type":
><!ATTLIST sensor type (GPS | WIND) "GPS">
>
>My question now is, if it is possible that the sub-elements of "sensor" are
>"longitude, latitude" only in the case when the type-attribute = "GPS".
>When the type-attribute = "WIND", the sub-elements shall exactly be
>"direction, speed".

No. An attribute specification can not be directly used to specify the
content model of an element that the attribute belongs to.

Chose a different approach to your problem. (Architectural processing
comes to mind but I have not investigated that approach any further at
this time)

-- 
Rex




transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent