Vzero Posted February 27, 2007 Share Posted February 27, 2007 Hey I was woundering how can I put an int varible in an xml file.Like I want to make it so a program when it reads the xml file it reads an int not a string. Link to comment Share on other sites More sharing options...
boen_robot Posted March 2, 2007 Share Posted March 2, 2007 XML on itself is plain data. You can put whatever you want. It all depends on the application made as to how it will use the data. For example, you can write <myElement myAttribute="1"/> where 1 can be read as a number or as a string, depending on the application reading.If you're asking about the schema datatypes you can use in other languages for XML, then look at XML Schema datatypes. Any schema aware processor or application is going to use all of those datatypes, which bring us back to the previous point.In XSLT 1.0, there is only boolean, number, string and node-set. XSLT 2.0 is shema awared, so it can produce/read-as any of the schema datatypes. Other languages that do not use schema may use their own datatypes. Link to comment Share on other sites More sharing options...
ashvini Posted March 26, 2007 Share Posted March 26, 2007 Hi, There is no need to specify any kind of data type in XML. As boen_robot told, XML is a structured data that's it.what data you deal whether int /float / char / string doesn't matter...So, if you want to access int value only, at the time of parsing XML file you can apply a simple filter to find whether fetched value is int of string.Better refer Google to find some sample program using DOM/SAX to access/fetch value from XML file. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now