Avatar of vcharles
vcharles
 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>
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
vcharles

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Fernando Soto

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
vcharles

ASKER
Thank You!
Fernando Soto

Not a problem Victor, always glad to help.
vcharles

ASKER
Hi again,

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

V.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Fernando Soto

Is that for CTRY_ID node? And what are the valid values for each x?
vcharles

ASKER
Hi,

It's for another data elemrnt "NASC".

Thanks,

V.
Fernando Soto

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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
vcharles

ASKER
OK. Will do.

Thank You.

V.