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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...