Page 1 of 1

Validate XML against XSD

Posted: Mon Aug 28, 2006 8:55 am
by uegodawa
Hi,
I'm trying to validate XML document against it's defined rules. Here is the job layout.
Folder ---> XML Input ---> Seq File.
I've tried with Validate XML input (General/Strict) but didn't get the results.
I've tried with Log rejected Error option. Didn't get the expected results.
Then I went through the XMLPACK_20_Designer.pdf file and include the XSD in the XML document's root element as follows.

<Chains xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com C:\CR\Chains.xsd">

Even I mentioned the schema loaction in the XML, it didn't validate.

Here is my validation rule :
All the TranType except 'A' and 'C' should be rejected.


<xs:element name="TranType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value='"A"'/>
<xs:enumeration value='"C"'/>
</xs:restriction>
</xs:simpleType>
</xs:element>


Please provide me details If I missed anything when I'm doing the validation.

Thanks
- U

Posted: Tue Aug 29, 2006 8:43 am
by Lotus26
HI

<Chains xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com C:\CR\Chains.xsd">


In your xml file please do specify the schema location like below and give a try.

<Chains xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="C:\CR\Chains.xsd">

Thanks.

Posted: Tue Aug 29, 2006 8:58 am
by uegodawa
Hi,
I tried that option as well. Here is the error I got;
TestValidateXSD..XML_Input_1: XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: , line: 1, column: 39): An exception occurred! Type:TranscodingException, Message:An invalid multi-byte source text sequence was encountered
Thanks
-U