This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > March 2005 > XmlValidatingReader bug: Parameter entity replacement





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author XmlValidatingReader bug: Parameter entity replacement
Michael Liu

2005-03-22, 4:32 am

XmlValidatingReader produces the error "The parameter entity replacement
text must nest properly within markup declarations" when it reads the
following document and associated DTD:

<!-- test.xml -->
<!DOCTYPE test SYSTEM "test.dtd" [ <!ENTITY % pe " | b"> ]>
<test />

<!-- test.dtd -->
<!ELEMENT test (a %pe;)*>

Both IE6 and Firefox parse test.xml successfully. Is there a workaround
for this bug? Will the problem be fixed in Whidbey?

Thanks,
Michael


Helena Kupkova

2005-03-22, 11:24 pm

Hello Michael,

This is not a bug in XmlValidatingReader nor it is a bug in IE6 or Firefox.
The XML spec gives the parser a choice to error. See section 3.2.1 of the
XML spec in Validity constraint: Proper Group/PE Nesting
(http://www.w3.org/TR/REC-xml/#sec-element-content):

"For interoperability, if a parameter-entity reference appears in a choice,
seq, or Mixed construct, its replacement text SHOULD contain at least one
non-blank character, and neither the first nor last non-blank character of
the replacement text SHOULD be a connector (| or ,)."

Thanks,
-Helena Kupkova, Microsoft

"Michael Liu" <practicalvb@hotmail.com> wrote in message
news:U7O%d.177$zl.152@newssvr13.news.prodigy.com...
> XmlValidatingReader produces the error "The parameter entity replacement
> text must nest properly within markup declarations" when it reads the
> following document and associated DTD:
>
> <!-- test.xml -->
> <!DOCTYPE test SYSTEM "test.dtd" [ <!ENTITY % pe " | b"> ]>
> <test />
>
> <!-- test.dtd -->
> <!ELEMENT test (a %pe;)*>
>
> Both IE6 and Firefox parse test.xml successfully. Is there a workaround
> for this bug? Will the problem be fixed in Whidbey?
>
> Thanks,
> Michael
>



Michael Liu

2005-03-24, 4:33 am

Thank you for the reply. As far as I can tell, the XML spec doesn't
specify
that it's an error to violate a constraint indicated by the keyword SHOULD,
SHOULD NOT, RECOMMENDED, MAY, or OPTIONAL. Thus, isn't XmlValidatingReader
nonconforming when it reports that test.xml is in error?

Michael


"Helena Kupkova" <HelenaKupkova@hotmail.com> wrote in message
news:epV0UJ1LFHA.3708@TK2MSFTNGP14.phx.gbl...
> Hello Michael,
>
> This is not a bug in XmlValidatingReader nor it is a bug in IE6 or
> Firefox. The XML spec gives the parser a choice to error. See section
> 3.2.1 of the XML spec in Validity constraint: Proper Group/PE Nesting
> (http://www.w3.org/TR/REC-xml/#sec-element-content):
>
> "For interoperability, if a parameter-entity reference appears in a
> choice, seq, or Mixed construct, its replacement text SHOULD contain at
> least one non-blank character, and neither the first nor last non-blank
> character of the replacement text SHOULD be a connector (| or ,)."
>
> Thanks,
> -Helena Kupkova, Microsoft
>
> "Michael Liu" <practicalvb@hotmail.com> wrote in message
> news:U7O%d.177$zl.152@newssvr13.news.prodigy.com...
>
>



Helena Kupkova

2005-03-25, 6:34 pm

You're right. We probably should not throw an error in this case.

-Helena

"Michael Liu" <practicalvb@hotmail.com> wrote in message
news:fJr0e.14965$C47.5494@newssvr14.news.prodigy.com...
> Thank you for the reply. As far as I can tell, the XML spec doesn't
> specify
> that it's an error to violate a constraint indicated by the keyword
> SHOULD,
> SHOULD NOT, RECOMMENDED, MAY, or OPTIONAL. Thus, isn't XmlValidatingReader
> nonconforming when it reports that test.xml is in error?
>
> Michael
>
>
> "Helena Kupkova" <HelenaKupkova@hotmail.com> wrote in message
> news:epV0UJ1LFHA.3708@TK2MSFTNGP14.phx.gbl...
>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews