I'm been working on this for the past couple hours and I believe I know the answer to my question, but I'm not sure why.
Problem I have is that I am trying to validate an XML document passed into my web service with an XSD file. The XSD file was built with the XML designer that comes with VS 2005. Each time I run the XmlReader class to validate the xml aginst the XSD at the confirmationNumber elemets does the validation raises an error of "The element cannot contain text. Content model is empty"
This one of my unique elements that contain both an attribute and has a inner text value. My observation is that the validator does not like the mixed attribute/element. Why I think this way I'm not sure, I've looked around the for any documentation that could be of some value but either there is none, which I believe is highly unlikely or I just did not search enough.
What I would hope is someone could give a once over to my XML / Schema if in fact I am doing something wrong or suggestion on how to maintain this mixed attribute/element.
Tools
Visual Studio 2005
2.0 Frameword
XML:
<?xml version=""1.0"" encoding=""utf-8"" ?>
<message command=""ApplicationRequest"">
<confirmationNumber Program=""A"">692993</confirmationNumber>
</message>
Schema:
<?xml version="1.0" encoding="utf-8"?>
<xschema id="DetailReport" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="message">
<xs:complexType>
<xsequence>
<xs:element ref="confirmationNumber" maxOccurs="1" minOccurs="1" />
</xsequence>
<xs:attribute name="command">
<xsimpleType>
<xs:restriction base="xstring">
<xs:enumeration value="ApplicationRequest" />
</xs:restriction>
</xsimpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="confirmationNumber">
<xs:complexType>
<xsequence />
<xs:attribute name="program">
<xsimpleType>
<xs:restriction base="xstring">
<xs:enumeration value="A" />
<xs:enumeration value="B" />
</xs:restriction>
</xsimpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xschema>