aspose file tools*
The moose likes XML and Related Technologies and the fly likes Reading node values in specified datatype in schema( .XSD) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Reading node values in specified datatype in schema( .XSD)" Watch "Reading node values in specified datatype in schema( .XSD)" New topic

Reading node values in specified datatype in schema( .XSD)

Jasleen Kaur

Joined: Jul 05, 2003
Posts: 1
I am a XML against which I have specified the schema also.I have attached the schema at run time using IXMLSchemaCollection interface.
It validates the XML fine, and I get the errors if the XML structure is not according to the schema structure defined, but the problem is that when I read the node values using GetNodeTypedValue , I always get a BSTR.
One more thing is that this whole works fine when the schema is in .XDR format,In this case I get values in proper datatype.
Then we tried a thing for that, while writing the XML value using SetNodeTypedValue we also set the datatype using put_datatype function. This way we are able to get the values in the proper datatype but we are not able to validate the XML with the schema.This happens because when we set the datattype of the node it adds a namespace refenence to the node --- xmlns t="urn:schemas-microsoft-com atatypes" dt t="string" -----
and the validate fn gives an error that these attributes are not defined in the schema.

Still the attributes are read in BSTR's only.
Please do guide me.If u can refer a sample where the schema used is .XSD format and we are validating the XML also and getting the values in correct datatypes, it wud be really helpful.
I am creating my schemas in XML Spy.
I agree. Here's the link:
subject: Reading node values in specified datatype in schema( .XSD)