Jump to content

XSD xs:pattern issue


mohxinn

Recommended Posts

Hi, I have simple type defined as:

<xs:simpleType name="revisionType">    <xs:restriction base="xs:string">	    <xs:minLength value="1"/>	    <xs:pattern value="[A-Z]+[0-9]*[A-Z]*"/>    </xs:restriction></xs:simpleType>

The XSD file validates fine but Xerces based validator gives error: Exception in thread "main" com.sun.org.apache.xerces.internal.impl.io.MalformeByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence. But it works when the simpletype element is defined as:

<xs:simpleType name="revisionType">    <xs:restriction base="xs:string">	    <xs:minLength value="1"/>	    <xs:pattern value="[A-Z]+[0-9]*"/>    </xs:restriction></xs:simpleType>

Why is that so? Is it an issue with Xerces?

Link to comment
Share on other sites

The issue is solved. The problem seemed to be in the XML file. There was a box like character within a tag that needed to be removed.Before the pattern changed that character was still there but it did not cause any problems but after modifying the pattern value the validator (Xerces) crashed.Anyways thanks!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...