Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with using schema to format data field

Hi,

I created the an xsd from an xml file, how do I modify it to limit 3 characters in the CTRY field and no numeric values?

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="Row">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="CTRY_ID" type="xs:unsignedByte" />
              <xs:element name="CTRY" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor  Charles

ASKER

Thank You!
Not a problem Victor, always glad to help.
Hi again,

How do I also enforce the following format: xx-xxx-xxxx?

V.
Is that for CTRY_ID node? And what are the valid values for each x?
Hi,

It's for another data elemrnt "NASC".

Thanks,

V.
In order to create a regular expression I need to know what the valid values for x.

Also please open another question for the new question, Thank you.
OK. Will do.

Thank You.

V.