Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Error XMLSchema Validation. "Type String is not declared"
    primarykey
    data
    text
    <p>I have an XML that looks like this</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!-- FCT Automated Data Transfer Configuration --&gt; &lt;config_info&gt; &lt;!--First Server --&gt; &lt;transfer_configuration ID="1"&gt; &lt;target_info&gt; &lt;connection_string&gt;Data Source=xyz;Initial Catalog=abc; User id=123; Password=Welcome1;&lt;/connection_string&gt; &lt;table_name&gt;t1234&lt;/table_name&gt; &lt;/target_info&gt; &lt;source_info&gt; &lt;access_file_path&gt;Provider= Microsoft Office 12.0 Access Database Engine OLE DB Provider ; Data Source=C:\Data\Data.accdb&lt;/access_file_path&gt; &lt;table_name&gt;Data&lt;/table_name&gt; &lt;/source_info&gt; &lt;transfer_interval_hours&gt;240&lt;/transfer_interval_hours&gt; &lt;retry_interval_minutes&gt;100&lt;/retry_interval_minutes&gt; &lt;transfer_interval_hours&gt;0&lt;/transfer_interval_hours&gt; &lt;field_map&gt; &lt;Field source="Test_DateTime" target="Test_DateTime" /&gt; &lt;Field source="UUT_SlotNumber" target="UUT_SlotNumber" /&gt; &lt;Field source="System_ID" target="System_ID" /&gt; &lt;/field_map&gt; &lt;failure_notification&gt; &lt;email_address_list&gt; &lt;email_address&gt;bob@abc.com&lt;/email_address&gt; &lt;email_address&gt;orson@abc.net&lt;/email_address&gt; &lt;email_address&gt;FrankieJ@abcd.com&lt;/email_address&gt; &lt;/email_address_list&gt; &lt;email_subject&gt;Automated Data Transfer Failure&lt;/email_subject&gt; &lt;email_body&gt; Automatic mail. &lt;/email_body&gt; &lt;/failure_notification&gt; &lt;/transfer_configuration&gt; &lt;!--A Second Server--&gt; &lt;transfer_configuration ID="more_unique_id"&gt; &lt;!-- ... remaining config information... --&gt; &lt;/transfer_configuration&gt; &lt;/config_info&gt; </code></pre> <p>and an xsd schema that I want to validate the xml. the schema is </p> <pre><code>&lt;xsd:schema xmlns:xsd=“http://www.w3.org/2001/XMLSchema”&gt; &lt;xsd:complexType name=“DatabaseInfoType”&gt; &lt;xsd:sequence&gt; &lt;xsd:choice&gt; &lt;xsd:element name=“connection_string” type=“string” /&gt; &lt;xsd:element name=“access_file_path” &gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base=“xsd:string”&gt; &lt;xsd:pattern value=“([C-Z]:)|(\\)\\[^%*?\|]+” /&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;/xsd:choice&gt; &lt;xsd:element name=“table_name” type=“string” /&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name=“ID” type=“string” use=“required” /&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name=“FieldMapType”&gt; &lt;xsd:sequence&gt; &lt;xsd:element name=“field” maxOccurs=“unbounded”&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name=“source” type=“xsd:NMTOKEN” use=“required” /&gt; &lt;xsd:attribute name=“target” type=“xsd:NMTOKEN” use=“required” /&gt; &lt;xsd:attribute name=“key” type=“xsd:boolean” /&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name=“PeriodIntervalsType”&gt; &lt;xsd:sequence&gt; &lt;xsd:element name=“transfer_interval_hours” &gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base=“xsd:positiveInteger”&gt; &lt;xsd:maxInclusive value=“240” /&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;xsd:element name=“retry_interval_minutes” &gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base=“xsd:positiveInteger”&gt; &lt;xsd:maxInclusive value=“100” /&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;xsd:element name=“initial_interval_minutes” &gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base=“xsd:positiveInteger”&gt; &lt;xsd:maxInclusive value=“100” /&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name=“FailureNotificationType”&gt; &lt;xsd:sequence&gt; &lt;xsd:element name=“email_to”&gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base=“xsd:string”&gt; &lt;xsd:pattern value=“([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})” /&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;xsd:element name=“email_subject” type=“string” /&gt; &lt;xsd:element name=“email_body” type=“string” /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name=“TransferConfigType” &gt; &lt;xsd:sequence&gt; &lt;xsd:element name=“target_info” type=“DatabaseInfoType” /&gt; &lt;xsd:element name=“source_info” type=“DatabaseInfoType” /&gt; &lt;xsd:element name=“intervals” type=“PeriodIntervalsType” /&gt; &lt;xsd:element name=“field_map” type=“FieldMapType” /&gt; &lt;xsd:element name=“failure_notification” type=“FailureNotificationType” /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;xsd:element name=“config_info”&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:element name=“transfer_configuration” type=“TransferConfigType” maxOccurs=“unbounded” /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:schema&gt; </code></pre> <p>But when I execute the command</p> <p>xmlFile.Validate(ConfigValHandler), I get the error as "Type 'string' is not declared, or is not a simple type."</p> <p>ConfigValHandler is error handler for XML Validation. I am unable to find the solution for this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload