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 Jianjun Zhang <ji...@eecs.umich.edu> on 2001/02/02 02:21:33 UTC
Attribute Value Normalization and DTD
Hi. I have encountered a problem with the following xml document and DTDs
using Xerces 1.3.1
DTD #1 : test.dtd
<!ENTITY % Definition.dtd SYSTEM "Definition.dtd">
%Definity.dtd;
<!ELEMENT test ( #PCDATA)>
<!ATTLIST test
%rangeValue >
DTD #2 : Definity.dtd
<!ENTITY % rangeValue " range CDATA #FIXED '[	-]'">
My XML Document :
<!DOCTYPE test PUBLIC .........>
<test range="[	-]">some data</test>
When I loaded the above document into DOM, I got an error:
Attribute 'range' has a value, '[ -]', that does
not match its #FIXED value,
'[ -]'
It seems somehow that the TAB character reference in the Entity Reference
has been normalized to a SPACE character. Is this specified in XML Spec? I
couldn't find it. Any helpful suggestions are welcome.
Thanks.
-JJ
Re: Attribute Value Normalization and DTD
Posted by Dean Roddey <dr...@charmedquark.com>.
Read the sections on whitespace normalization. Attributes are subject to
whitespace normalization, with slight variations according to what kind of
attribute they are. Now, whether that normalization should have been applied
exactly the same in both the attribute def and the instance value of it in
the doc, I can't remember right off the top of my head. But you'd think that
they would be treated the same, and seen as correct (even though they might
not still contain what you had hoped they would.)
--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com
"We're gonna need a bigger boat"
----- Original Message -----
From: "Jianjun Zhang" <ji...@eecs.umich.edu>
To: <xe...@xml.apache.org>
Sent: Thursday, February 01, 2001 5:21 PM
Subject: Attribute Value Normalization and DTD
> Hi. I have encountered a problem with the following xml document and DTDs
> using Xerces 1.3.1
>
> DTD #1 : test.dtd
>
> <!ENTITY % Definition.dtd SYSTEM "Definition.dtd">
> %Definity.dtd;
> <!ELEMENT test ( #PCDATA)>
> <!ATTLIST test
> %rangeValue >
>
> DTD #2 : Definity.dtd
>
> <!ENTITY % rangeValue " range CDATA #FIXED '[	-]'">
>
> My XML Document :
> <!DOCTYPE test PUBLIC .........>
> <test range="[	-]">some data</test>
>
> When I loaded the above document into DOM, I got an error:
>
> Attribute 'range' has a value, '[ -]', that does
> not match its #FIXED value,
> '[ -]'
>
>
> It seems somehow that the TAB character reference in the Entity Reference
> has been normalized to a SPACE character. Is this specified in XML Spec? I
> couldn't find it. Any helpful suggestions are welcome.
>
> Thanks.
>
> -JJ
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>