Hi guys, I am resonably new to XSD so I appologise if my question is simple. I am attempting to use an XSD to validate my XML document which previously used a DTD for validation. The problem is that I keep getting this error message:
ORA-19202: Error occurred in XML processing
LSX-00310: local element or attribute should be namespace qualified.
I have validated both the XML file and the XSD individually and against each other in AltovaXMLSpy and the software tells me that they are valid but as soon as I run them in my PLSQL application I get the error message above. here are both the XML and the XSD files I am using if anyone could help me I would be very grateful.
------------------------XSD-------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:complexType name="transactionHeaderType">
<xs:all>
<xs:element name="tranType" type="xs:string"/>
<xs:element name="agencyId" type="xs:string">
<xs:annotation>
<xs:documentation>agencyId of the submitting agency</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="agencyOfficeCode" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>The office code of the submitting agency</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="reqDTS">
<xs:annotation>
<xs:documentation>Submit date and time</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="date">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="8"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="time">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="6"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="reqId" type="xs:string">
<xs:annotation>
<xs:documentation>reference number</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="agencyRefNumber" type="xs:string">
<xs:annotation>
<xs:documentation>The agency's reference number</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="errorCode" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>Return value non zero indicates an error</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
<xs:element name="msg">
<xs:annotation>
<xs:documentation>Root Element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="msgHeader" type="msgHeaderType"/>
<xs:element name="payload">
<xs:complexType>
<xs:sequence>
<xs:element name="tran" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="header" type="transactionHeaderType">
<xs:annotation>
<xs:documentation>Transaction header</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="data" minOccurs="0">
<xs:annotation>
<xs:documentation>Transaction data</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="subjectName" type="subjectNameType"/>
<xs:element name="totalMatchesFound" type="xs:integer"/>
<xs:element name="reqStatus" default="RELSE" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="5"/>
<xs:enumeration value="COLLD"/>
<xs:enumeration value="FINAL"/>
<xs:enumeration value="HELD"/>
<xs:enumeration value="PEND"/>
<xs:enumeration value="REFRD"/>
<xs:enumeration value="RELSE"/>
<xs:enumeration value="SUBMT"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="match" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="matchJursId">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AFP"/>
<xs:enumeration value="NSW"/>
<xs:enumeration value="NT"/>
<xs:enumeration value="QLD"/>
<xs:enumeration value="SA"/>
<xs:enumeration value="TAS"/>
<xs:enumeration value="VIC"/>
<xs:enumeration value="WA"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="matchesFound">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="1"/>
<xs:enumeration value="Y"/>
<xs:enumeration value="N"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="msgHeaderType">
<xs:all minOccurs="0">
<xs:element name="destination">
<xs:complexType>
<xs:all>
<xs:element name="process" type="xs:string"/>
<xs:element name="gateway" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="deliveryMode" type="xs:string" minOccurs="0"/>
<xs:element name="expiration" type="xs:string" minOccurs="0"/>
<xs:element name="priority" type="xs:string" minOccurs="0"/>
<xs:element name="msgId" type="xs:string" minOccurs="0"/>
<xs:element name="timestamp" type="xs:string" minOccurs="0"/>
<xs:element name="correlationId" type="xs:string" minOccurs="0"/>
<xs:element name="replyTo" type="xs:string" minOccurs="0"/>
<xs:element name="org" type="xs:string" minOccurs="0"/>
<xs:element name="type" type="xs:string" minOccurs="0"/>
<xs:element name="redelivered" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
<xs:complexType name="subjectNameType">
<xs:sequence>
<xs:element name="surname" type="xs:string"/>
<xs:element name="given" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
----------------------XML------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<msg>
<msgHeader>
<destination>
<gateway>xxx</gateway>
<process>EAMS4_REPLY</process>
</destination>
<replyTo>yyy</replyTo>
<org>SOMEORG</org>
</msgHeader>
<payload>
<tran>
<header>
<agencyId>15</agencyId>
<agencyOfficeCode>SOMECODE</agencyOfficeCode>
<agencyRefNumber>1074273</agencyRefNumber>
<errorCode>16</errorCode>
<reqDTS>
<date>20070920</date>
<time>125727</time>
</reqDTS>
<reqId>0</reqId>
<tranType>EAMS4_REPLY</tranType>
</header>
</tran>
</payload>
</msg>
Thanks a lot