Re: [xml] Is this legal?



On Wed, Jun 06, 2001 at 06:29:23PM +0100, Gary Pennington wrote:
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
yes.



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*) )>
<!ATTLIST avp
        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>

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

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

</dictionary>

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.

Even though the type-name, "ARAP-Features" is refering to an avp name
attribute?

I had "assumed" that the attribute names were matched up.  Looks like I was
wrong.


-Dave




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