Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - passing integer value in XML mode??? [Thread Next] Re: passing integer value in XML mode???To: NULL Date: 8/21/2009 12:05:00 PM
robson wrote:
> is there any way to pass integer value in XML document? I have web service
> accepting as one of the arguments integer, but I supplying those arguments
> from XML document hence the problem, because I would not like to convert this
> in application.
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<data xsi:type="xs:int">1</data>
</root>
would signal to a schema aware XML parser that the contents of the
'data' element is of the XML schema type int defined here:
http://www.w3.org/TR/xmlschema-2/#int
As an alternative you can also define a complete schema e.g.
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="data" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
