File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Product and Other Certifications and the fly likes xsd: how to define an element of type integer which can validate even if it is empty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Reply locked New topic
Author

xsd: how to define an element of type integer which can validate even if it is empty

Bipul Kumar Singh
Greenhorn

Joined: Jul 08, 2004
Posts: 6
Hi,

Can anyone help me solve this problem

I want to define an element to type integer
so we can do something like this ...

<xs:simpleType name="status">
<xs:annotation>
<xs ocumentation>0=CLOSED</xs ocumentation>
<xs ocumentation>1=OPEN</xs ocumentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>
But the problem is this will not validate an xml
<status></status>

Can anyone pl. tell me what I can use in XSD so that this gets validated
Note: I cant add any thing in xml as its getting generated automatically

Thanks in advance
Bipul
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Please do not cross-post the same question to several places.
I'm closing this thread. Please continue the discussion over there.

Thank you.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: xsd: how to define an element of type integer which can validate even if it is empty