Hi,
It is not clear from your post what exactly you are looking for. For
instance
<OneElement oneAttribute="1">2</OneElement>
is an example containing OneElement whose value is 2 (that is integer)
and oneAttribute whose value is 1 (again integer).
The common APIs for parsing XML documents DOM and SAX do not offer a
method that returns Integer to get the value of an attribute or of an
element. You can however try to convert the attribute value or the
value of the text content of an element to Integer and see if that
fails or not. Also if you use a schema then you can specify there that
you want integer values and if the document is valid against that
schema then you know that you will be able to convert those values to
Integer.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
veeman wrote:
> Can someone please write an example containing one element which value is
> integer type, and one attribute which value is also integer type:
>
> Is it something like this:
>
> <SomeAttribute AttrType:type="integer"
>
> How to specify value of 3 for example? When I parse it, will I get 3 as an
> integer or as a string?
>
> thank you very much!