• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

datatype

 
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While interacting with database, is there any way to know the datatypes in an XML document?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are talking about how to know the data type of an element in a document, that is covered by XML Schema. Here is an element from a SOAP message that is labeled as conforming to a particular format for a date.
<return xsi:type="xsd:date">1939-10-17</return>
Bill
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I actually want to read data from XML and write to the XML document and even the vice-versa. I want somehow to know the datatypes of the data present in the XML document.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by parmeet bedi:
No, I actually want to read data from XML and write to the XML document and even the vice-versa. I want somehow to know the datatypes of the data present in the XML document.


Hi Permeet,
There are data types in XML Schema, and there are basic data types in an XML DTD, but unless you have access to those documents you'll just be guessing. However, from the context or element names you may be able to do a very good job guessing.
Hope this helps.
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guessing won't help. In that case the records won't be inserted in the database resulting in an error. Any solution for that?
BTW can you elaborate more on schema datatypes you had mentioned?
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!