You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Dean Roddey <dr...@charmedquark.com> on 2002/09/03 19:04:41 UTC

RE: problems with IDREF

The problem is that it's an IDREF. IDREF attributes must refer to some
ID attribute somewhere in the file. So it's probably not a good thing to
provided IDREF attributes with defaulted values.

-------------------------------------
Dean Roddey
The Charmed Quark Controller
droddey@charmedquark.com
www.charmedquark.com
 

-----Original Message-----
From: Vivekanand V. [mailto:VVivekanand@quark.co.in] 
Sent: Tuesday, September 03, 2002 6:48 AM
To: 'xerces-c-dev@xml.apache.org'
Subject: problems with IDREF 

I have a file with the content below

<?xml version="1.0" standalone="yes"?>
<!DOCTYPE DOCUMENT [
	<!ELEMENT DOCUMENT (PERSON*)>
	<!ELEMENT PERSON (#PCDATA)>
	<!ATTLIST PERSON
	PNUMBER ID #REQUIRED
		FATHER IDREF "DefaultValue"
		MOTHER IDREF "DefaultValue"
>
]>
<DOCUMENT>
</DOCUMENT>

When i parse this file xerces gives a error

 Message: ID attribute 'DefaultValue' was referenced but never declared

The specifications says that

3.3.2 Attribute Defaults

In an attribute declaration, #REQUIRED means that the attribute must
always
be provided, #IMPLIED
that no default value is provided. [Definition: If the declaration is
neither #REQUIRED nor #IMPLIED,
then the AttValue [p.9] value contains the declared default value; the
#FIXED keyword states that the
attribute must always have the default value. If a default value is
declared, when an XML processor
encounters an omitted attribute(Here they did say if this is for a given
occurance of element or the whole XML document), it is to behave as
though
the attribute were present with the declared default value.] 

Specification does not say what happens when the elements do not exist.
Is this a bug?

Thanks 
Vivekanand


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org