Jump to content
Sign in to follow this  
pavankumard

Passing null values for numeric field

Recommended Posts

Hi, I have an element NumericField as shown below. ......... <xs:element name="NumericField" nillable="true" minOccurs="0" maxOccurs="unbounded" > <xs:complexType> <xs:simpleContent> <xs:extension base="xs:integer"> <xs:attribute name="Number" form="unqualified" type="xs:integer" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> ....... In the input XML for above schema i should be able to pass a tag like <NumericField Number="1" />How to achieve this?Thanks in advance.-Pavan.

Share this post


Link to post
Share on other sites

I think it should be just

<xs:element name="NumericField" nillable="true" minOccurs="0" maxOccurs="unbounded" ><xs:complexType><xs:attribute name="Number" form="unqualified" type="xs:integer" /></xs:complexType></xs:element>

xs:simpleContent defines the content of an element, not its attributes. And there's no need to extend xs:integer if that's the only thing you're using.

Share this post


Link to post
Share on other sites
I think it should be just
<xs:element name="NumericField" nillable="true" minOccurs="0" maxOccurs="unbounded" ><xs:complexType><xs:attribute name="Number" form="unqualified" type="xs:integer" /></xs:complexType></xs:element>

xs:simpleContent defines the content of an element, not its attributes. And there's no need to extend xs:integer if that's the only thing you're using.

I am sorry, I didnt put the question properly. The schema should also suppor the tags like<NumericField Number="1">123.456</NumericField> , here 123.456 is just an example, it can any valid decimal number.so, in addition to the above it should also support the below tag..<NumericField Number="1" />

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...