[Mono-bugs] [Bug 584664] New: Xml schema violations are indicated when an element base type contains sub-elements of an extension type of that base type
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Mar 2 09:24:45 EST 2010
http://bugzilla.novell.com/show_bug.cgi?id=584664
http://bugzilla.novell.com/show_bug.cgi?id=584664#c0
Summary: Xml schema violations are indicated when an element
base type contains sub-elements of an extension type
of that base type
Classification: Mono
Product: Mono: Class Libraries
Version: 2.6.x
Platform: 32bit
OS/Version: Windows Vista
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.XML
AssignedTo: atsushi at ximian.com
ReportedBy: florianhaag at freenet.de
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
Created an attachment (id=345988)
--> (http://bugzilla.novell.com/attachment.cgi?id=345988)
C# source for a little Xml validator + 2 xml schemas + 2 xml documents
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.1.2)
Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
In an Xml schema, I define a complex type "base" and a complex type "derived".
"base" may contain an element "leaf" (no particular type) and optionally an
element "nested" of type "base". "derived" is defined as an extension of
"base".
The root element must be of type "derived".
(attached schema1.xsd)
A minimal document satisfying this schema, such as:
<?xml version="1.0"?>
<root xmlns="http://a">
<leaf/>
</root>
(attached document1.xml)
validates in .NET 3.5 when loaded using System.Xml.XmlReader.Create and
supplying an XmlReaderSettings-instance that asks for schema validation. In
Mono, the same code produces validation errors, saying that the leaf element is
invalid there (see actual result).
If the schema is changed so that "base" can only contain an element "leaf",
there are no validation errors (attached schema2.xsd and document2.xml).
Reproducible: Always
Steps to Reproduce:
1. Extract the attached file TestCase.tar.gz.
2. Compile TinyXmlValidator.cs (e.g. gmcs TinyXmlValidator.cs)
3. Run TinyXmlValidator.exe with Mono:
mono TinyXmlValidator.exe -s schema1.xsd -d document1.xml
=> Actual Results.
4a. For a comparison, validate on .NET:
TinyXmlValidator -s schema1.xsd -d document1.xml
=> Expected Results.
4b. For a comparison, validate the changed schema:
mono TinyXmlValidator.exe -s schema2.xsd -d document2.xml
=> Expected Results.
Actual Results:
Error: XmlSchema error: Invalid start element: http://a:leaf XML Line 3,
Position 4. (Line 3, Column 4)
Error: XmlSchema error: Element declaration for http://a:leaf is missing. XML
Line 3, Position 4. (Line 3, Column 4)
Error: XmlSchema error: Invalid end element. There are still required content
items. XML Line 4, Position 3. (Line 4, Column 3)
Expected Results:
Successful validation.
I am using a German Windows Vista 32 Bit SP 2 and Mono 2.6.1.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list