Re: [xml] Is this legal?

David Frascone wrote:

Are ID/IDREF pairs supposed to be document wide, ignoring the attribute name?

If this means "does an ID have global scope in a document?", then the answer is

Given the following DTD fragment:

<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT typedefn EMPTY>
<!ATTLIST typedefn
        type-name ID #REQUIRED
        description CDATA #IMPLIED

<!ELEMENT avp ((type | grouped), (enum*) )>
        name ID #REQUIRED
        description CDATA #IMPLIED
        code CDATA #REQUIRED
        may-encrypt (true | false) "true"
        mandatory-flag (disallowed | allowed | required) "allowed"
        vendor-specific (true | false) "false"
        vendor-id IDREF #IMPLIED
        constrained (true | false) "false"

Should this XML fragment be legal?  (xmllint --valid thinks so)

        <typedefn type-name"someType" />

Small typo correction ->        <typedefn type-name="someType" />

        <avp name="ARAP-Features" code="71">
                <type type-name="OctetString"/>

        <avp name="Good-AVP" code="1">
                <type type-name="someType"/>

        <avp name="Bad-AVP" code="2">
                <type type-name="ARAP-Features"/>


It looks valid to me. Your DTD fragment identifies two IDs type-name on
<typedefn> and name on <avp>. There are no clashes between these attributes that
I can see, so I think it's valid.


xml mailing list
xml gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]