Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

how to create our own boolean type in XSD?

Hi,

One of my XML element <TaxDocumentationRequired> should have either 'Y' or 'N'.

I did as below - but still it did not work for me.
It says "Type 'http://www.w3.org/2001/XMLSchema:myBoolean' " is not declared.

<xs:element type="xs:myBoolean" name="TaxDocumentationRequired"/>

<xs:simpleType name="myBoolean">
      <xs:restriction base="xs:string">
            <xs:enumeration value="Y"/>
            <xs:enumeration value="N"/>
      </xs:restriction>
</xs:simpleType>

Can anyone help please?
0
GouthamAnand
Asked:
GouthamAnand
  • 2
1 Solution
 
Geert BormansInformation ArchitectCommented:
you can't declare types in the xs schema namespace,
it needs to be in the targetNamespace

<xs:element type="myBoolean" name="TaxDocumentationRequired"/>

should work
0
 
GouthamAnandAuthor Commented:
Thanks a lot.
0
 
Geert BormansInformation ArchitectCommented:
welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now