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 Mathias Mueller <ma...@rostock.zgdv.de> on 2003/11/12 12:51:53 UTC

Default Values

Hi,

I am using the XercesDOMParser with validation.

The Parser is not only reading out the information stored in the XML-file
but also all the not stored attributes with their default values.

No I wanna know how to turn that of.

I have the default values stored in my own structure and it would save me
a lot of work at runtime not to read out all attributes.
Especially since not all attributes have a default value I would be forced
to write code for ignoring them.

Can anybody help me with this?

with kind regards

Mathias Mueller
Rostock Germany - Olympia 2012

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


Reason

Posted by Mathias Mueller <ma...@rostock.zgdv.de>.
Hi Graham,

The reason simply is, that I have the default values already stored in my
own structure, so I don't need them.
Additionally there are some attributes in the DTD I use who never have a
value and so never are to be read out. But Xerces gives me those with no
value. With these attributes given I would have to check for them when
reading out the file.

I could do all of it, but why not avoid the extra work. Especially its a
difference to read out and check 1 or 10 attributes at runtime.

Mathias

> Mathias,
>
> 'Scuse me for butting in but...
>
> Is there a reason why you want to validate when reading but not use the
> schema default values.
> I can see advantages in either having both or having none ...
>
> At 12/11/2003 12:20  Wednesday, Mathias Mueller wrote:



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


Re: Re: Default Values

Posted by Graham Mann <gm...@adobe.com>.
Mathias,

'Scuse me for butting in but...

Is there a reason why you want to validate when reading but not use the schema default values.
I can see advantages in either having both or having none ... 

At 12/11/2003 12:20  Wednesday, Mathias Mueller wrote:
>Hi Anton,
>
>yeah, this command does it.
>I had to force him to convert the DOMNode to DOMAttr, but it works. :)
>
>Thanks for the quick help.
>
>Mathias
>
>P.S. I strangely received your mail 3 times. Any idea why?
>
>> Hi Mathias,
>>
>> you can add a check on your attributes:
>> if (pAttr->getSpecified()) returns false, it's a default value from the
>> DTD
>>
>> <include/DOM/DOMAttr.hpp>
>>
>> HTH,
>> Anton
>>
>> ----- Original Message -----
>> From: "Mathias Mueller" <ma...@rostock.zgdv.de>
>> To: <xe...@xml.apache.org>
>> Sent: Wednesday, November 12, 2003 12:51 PM
>> Subject: Default Values
>>
>>
>> Hi,
>>
>> I am using the XercesDOMParser with validation.
>>
>> The Parser is not only reading out the information stored in the XML-file
>> but also all the not stored attributes with their default values.
>>
>> No I wanna know how to turn that of.
>>
>> I have the default values stored in my own structure and it would save me
>> a lot of work at runtime not to read out all attributes.
>> Especially since not all attributes have a default value I would be forced
>> to write code for ignoring them.
>>
>> Can anybody help me with this?
>>
>> with kind regards
>>
>> Mathias Mueller
>> Rostock Germany - Olympia 2012
>>
>> ---------------------------------------------------------------------
>> 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


Graham Mann
Adobe Systems Europe Ltd.



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


Re: Re: Default Values

Posted by Mathias Mueller <ma...@rostock.zgdv.de>.
Hi Anton,

yeah, this command does it.
I had to force him to convert the DOMNode to DOMAttr, but it works. :)

Thanks for the quick help.

Mathias

P.S. I strangely received your mail 3 times. Any idea why?

> Hi Mathias,
>
> you can add a check on your attributes:
> if (pAttr->getSpecified()) returns false, it's a default value from the
> DTD
>
> <include/DOM/DOMAttr.hpp>
>
> HTH,
> Anton
>
> ----- Original Message -----
> From: "Mathias Mueller" <ma...@rostock.zgdv.de>
> To: <xe...@xml.apache.org>
> Sent: Wednesday, November 12, 2003 12:51 PM
> Subject: Default Values
>
>
> Hi,
>
> I am using the XercesDOMParser with validation.
>
> The Parser is not only reading out the information stored in the XML-file
> but also all the not stored attributes with their default values.
>
> No I wanna know how to turn that of.
>
> I have the default values stored in my own structure and it would save me
> a lot of work at runtime not to read out all attributes.
> Especially since not all attributes have a default value I would be forced
> to write code for ignoring them.
>
> Can anybody help me with this?
>
> with kind regards
>
> Mathias Mueller
> Rostock Germany - Olympia 2012
>
> ---------------------------------------------------------------------
> 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


Re: Default Values

Posted by Anton Triest <ck...@pandora.be>.
Hi Mathias,

you can add a check on your attributes:
if (pAttr->getSpecified()) returns false, it's a default value from the DTD

<include/DOM/DOMAttr.hpp>

HTH,
Anton

----- Original Message ----- 
From: "Mathias Mueller" <ma...@rostock.zgdv.de>
To: <xe...@xml.apache.org>
Sent: Wednesday, November 12, 2003 12:51 PM
Subject: Default Values


Hi,

I am using the XercesDOMParser with validation.

The Parser is not only reading out the information stored in the XML-file
but also all the not stored attributes with their default values.

No I wanna know how to turn that of.

I have the default values stored in my own structure and it would save me
a lot of work at runtime not to read out all attributes.
Especially since not all attributes have a default value I would be forced
to write code for ignoring them.

Can anybody help me with this?

with kind regards

Mathias Mueller
Rostock Germany - Olympia 2012

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