EDN Admin
Well-known member
Hello,<br/>
I have simple problem. I have XSD file:<br/>
<br/>
<?xml version="1.0" encoding="utf-8"?><br/>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema <br/>
<xs:element name="SEZON" type="sezon-type <br/>
</xs:element><br/>
<br/>
<br/>
<xs:complexType name="sezon-type <br/>
<xs:attribute name="TEST" use="required <br/>
<xs:simpleType><br/>
<xs:restriction base="xs:string <br/>
<xsattern value="yes|no"/><br/>
</xs:restriction><br/>
</xs:simpleType><br/>
</xs:attribute><br/>
</xs:complexType><br/>
</xs:schema><br/>
<br/>
and code:<br/>
<br/>
using<br/>
(<br/>
var stream = new System.IO.StringReader<br/>
(<br/>
System.IO.File.ReadAllText(@"ContentXML-TestModel.xsd")<br/>
)<br/>
)<br/>
{<br/>
var schema = System.Xml.Schema.XmlSchema.Read<br/>
(<br/>
stream, (s, a) =><br/>
{<br/>
}<br/>
);<br/>
<br/>
<br/>
var b = schema.SchemaTypes<br/>
[<br/>
new System.Xml.XmlQualifiedName("sezon-type")<br/>
];<br/>
}<br/>
<br/>
but variable "b" is always NULL. What am I doing wrong?
View the full article
I have simple problem. I have XSD file:<br/>
<br/>
<?xml version="1.0" encoding="utf-8"?><br/>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema <br/>
<xs:element name="SEZON" type="sezon-type <br/>
</xs:element><br/>
<br/>
<br/>
<xs:complexType name="sezon-type <br/>
<xs:attribute name="TEST" use="required <br/>
<xs:simpleType><br/>
<xs:restriction base="xs:string <br/>
<xsattern value="yes|no"/><br/>
</xs:restriction><br/>
</xs:simpleType><br/>
</xs:attribute><br/>
</xs:complexType><br/>
</xs:schema><br/>
<br/>
and code:<br/>
<br/>
using<br/>
(<br/>
var stream = new System.IO.StringReader<br/>
(<br/>
System.IO.File.ReadAllText(@"ContentXML-TestModel.xsd")<br/>
)<br/>
)<br/>
{<br/>
var schema = System.Xml.Schema.XmlSchema.Read<br/>
(<br/>
stream, (s, a) =><br/>
{<br/>
}<br/>
);<br/>
<br/>
<br/>
var b = schema.SchemaTypes<br/>
[<br/>
new System.Xml.XmlQualifiedName("sezon-type")<br/>
];<br/>
}<br/>
<br/>
but variable "b" is always NULL. What am I doing wrong?
View the full article