[Mono-bugs] [Bug 599479] New: XmlSchema doesn't round-trip with XmlDictionaryBinaryWriter

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Apr 24 14:38:36 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=599479

http://bugzilla.novell.com/show_bug.cgi?id=599479#c0


           Summary: XmlSchema doesn't round-trip with
                    XmlDictionaryBinaryWriter
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: harinath at hurrynot.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=356660)
 --> (http://bugzilla.novell.com/attachment.cgi?id=356660)
repro.

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4
(KHTML, like Gecko) Chrome/5.0.375.19 Safari/533.4

When I try to XML-deserialize an Xml serialized with XmlDictionaryBinaryWriter,
I get an exception:

Unhandled Exception: System.Xml.Schema.XmlSchemaException: XmlSchema error:
xmlns:xs is not a valid attribute for choice
  at System.Xml.Schema.ValidationHandler.RaiseValidationEvent
(System.Xml.Schema.ValidationEventHandler handle, System.Exception
innerException, System.String message, System.Xml.Schema.XmlSchemaObject xsobj,
System.Object sender, System.String sourceUri, XmlSeverityType severity)
[0x00000] in <filename unknown>:0 
[...]

Reproducible: Always

Steps to Reproduce:
Compile and run the attached code.
Actual Results:  
dump text: <ds><xs:schema id="ds" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element name="ds"
msdata:IsDataSet="true"
msdata:UseCurrentLocale="true"><xs:complexType><xs:choice minOccurs="0"
maxOccurs="unbounded"><xs:element
name="dt"><xs:complexType><xs:sequence><xs:element name="n" type="xs:int"
minOccurs="0" /><xs:element name="s" type="xs:string" minOccurs="0"
/></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema><dt><n>5</n><s>five</s></dt><dt><n>10</n><s>ten</s></dt></ds>

dt
=======
    n    s
    -----    -----
    5    five
    10    ten


dump binary: @.dsA.xs.schema..id..ds..xs
http://www.w3.org/2001/XMLSchema....msdata$urn:schemas-microsoft-com:xml-msdataA.xs.element..name..ds..msdata.IsDataSet..true..msdata.UseCurrentLocale..trueA.xs.complexTypeA.xs.choice..minOccurs...maxOccurs..unboundedA.xs.element..name..dtA.xs.complexTypeA.xs.sequenceA.xs.element..name..n..type..xs:int..minOccurs..A.xs.element..name..s..type..xs:string..minOccurs.........@.dt@.n..5@.s..five.@.dt@.n..10@.s..ten..

Unhandled Exception: System.Xml.Schema.XmlSchemaException: XmlSchema error:
xmlns:xs is not a valid attribute for choice
  at System.Xml.Schema.ValidationHandler.RaiseValidationEvent
(System.Xml.Schema.ValidationEventHandler handle, System.Exception
innerException, System.String message, System.Xml.Schema.XmlSchemaObject xsobj,
System.Object sender, System.String sourceUri, XmlSeverityType severity)
[0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaObject.error
(System.Xml.Schema.ValidationEventHandler handle, System.String message,
System.Exception innerException, System.Xml.Schema.XmlSchemaObject xsobj,
System.Object sender) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaObject.error
(System.Xml.Schema.ValidationEventHandler handle, System.String message,
System.Exception innerException) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaChoice.Read (System.Xml.Schema.XmlSchemaReader
reader, System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename
unknown>:0 
  at System.Xml.Schema.XmlSchemaComplexType.Read
(System.Xml.Schema.XmlSchemaReader reader,
System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaElement.Read (System.Xml.Schema.XmlSchemaReader
reader, System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename
unknown>:0 
  at System.Xml.Schema.XmlSchema.ReadContent (System.Xml.Schema.XmlSchema
schema, System.Xml.Schema.XmlSchemaReader reader,
System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchema.Read (System.Xml.XmlReader rdr,
System.Xml.Schema.ValidationEventHandler validationEventHandler) [0x00000] in
<filename unknown>:0 
  at System.Data.XmlSchemaDataImporter..ctor (System.Data.DataSet dataset,
System.Xml.XmlReader reader, Boolean forDataSet) [0x00000] in <filename
unknown>:0 
  at System.Data.DataSet.ReadXmlSchema (System.Xml.XmlReader reader) [0x00000]
in <filename unknown>:0 
  at System.Data.DataSet.ReadXml (System.Xml.XmlReader reader, XmlReadMode
mode) [0x00000] in <filename unknown>:0 
  at XmlSchema.MainClass.Deserialize (System.IO.Stream s, Boolean binary)
[0x00000] in <filename unknown>:0 
  at XmlSchema.MainClass.Test (Boolean binary) [0x00000] in <filename
unknown>:0 
  at XmlSchema.MainClass.Main (System.String[] args) [0x00000] in <filename
unknown>:0 


Expected Results:  
dump text: <ds><xs:schema id="ds" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xm
lns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element name="ds"
msdata:I
sDataSet="true" msdata:UseCurrentLocale="true"><xs:complexType><xs:choice
minOcc
urs="0" maxOccurs="unbounded"><xs:element
name="dt"><xs:complexType><xs:sequence
><xs:element name="n" type="xs:int" minOccurs="0"/><xs:element name="s" type="xs
:string"
minOccurs="0"/></xs:sequence></xs:complexType></xs:element></xs:choice>
</xs:complexType></xs:element></xs:schema><dt><n>5</n><s>five</s></dt><dt><n>10<
/n><s>ten</s></dt></ds>

dt
=======
        n       s
        -----   -----
        5       five
        10      ten


dump binary: @.dsA.xs.schema..id..ds..xs
http://www.w3.org/2001/XMLSchema..msdat
a$urn:schemas-microsoft-com:xml-msdataA.xs.element..name..ds..msdata.IsDataSet..
true..msdata.UseCurrentLocale..trueA.xs.complexTypeA.xs.choice..minOccurs...maxO
ccurs..unboundedA.xs.element..name..dtA.xs.complexTypeA.xs.sequenceA.xs.element.
name..n..type..xs:int..minOccurs..A.xs.element..name..s..type..xs:string..minOc
curs......... at .dt@.n..5 at .s..five.@.dt at .n..10@.s..ten..

dt
=======
        n       s
        -----   -----
        5       five
        10      ten


Distilled from a WCF net.tcp service operation that tried to return a
DataTable.

-- 
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