• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic