>1. Is it possible to tell the parser to distinguish between an empty
>attribute value and no attribute at all?

A completely absent attribute value, with no default, doesn't show up in
the SAX/DOM datastructures at all. (Though in the DOM you have to use
getAttributeNode() or equivalent to see this distinction, since there's a
convenience feature which causes getAttribute() to return "" when the
attribute is absent.)

If you're using the DOM, you can distinguish whether it was a default by
checking the Attr node's "specified" flag, which is true if the attribute
was specified explicitly and false if it came from a default. I'm not sure
offhand whether SAX has an equivalent test.

>2. Is it possible to set an attribute value to an empty string or NULL?

Empty string: Sure, trivially. Just set it to "".
Null: Only by not having a value, which means not having a default either.

>3. If 1 & 2 are answered with no: Is this an xml probleme, a xerces
>problem or my own problem ? ;-)

If "" isn't an acceptable equivalent of null, redesign your
application/DTD. Either don't specify a default, or write your application
so it recognizes a reserved value such as the empty string in lieu of (or
as an equivalent to) the attribute being absent.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to