Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML not valid against XSD

Status
Not open for further replies.

Krc4

Programmer
Nov 27, 2008
2
BE
Dear Members,

When I validate the XML file

(here you can see a little part of it)
<account>
<CustomerNumber>4999</CustomerNumber>
<VAT>BE0463855575</VAT>
<Name>AFFRESH</Name>
<Street>WALLETJE</Street>
<HouseNumber>1</HouseNumber>
<ZipCode>5800</ZipCode>
<Locality>HAL</Locality>
<Activity>Food</Activity>
</account>

I receive an error saying the HouseNumber doesn't match the pattern: "^[A-Z,a-z,0-9,/,-., ]{0,10}$"

little part of the XSD:
<xs:simpleType name="houseNumberType">
<xs:restriction base="xs:string">
<xs:pattern value="^[A-Z,a-z,0-9,/,-., ]{0,10}$" />
</xs:restriction>
</xs:simpleType>


Does somebody know how I can make my xml valid?

Thanks!
 
><xs:pattern value="^[A-Z,a-z,0-9,/,-., ]{0,10}$" />
[tt]<xs:pattern value="[A-Za-z0-9/-. ]{0,10}" />[/tt]

Charset is not comma separated. If you mean actually including comma as well then add it back.
[tt]<xs:pattern value="[A-Za-z0-9/-., ]{0,10}" />[/tt]
 
Hello,

I received the reason:

"XML Schema's pattern facet uses a regular expression language that supports Unicode. It is fully described in XML Schema Part 2. The language is similar to the regular expression language used in the Perl Programming language, although expressions are matched against entire lexical representations rather than user-scoped lexical representations such as line and paragraph. For this reason, the expression language does not contain the metacharacters ^ and $, although ^ is used to express exception, e.g. [^0-9]x. "

(cfr.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top