Determining an XMLNode's Schema Type

B

Bubba

Hi All,

I'm presently populating a DataGridView with data extracted from an XML
file, but since there is a range of datatypes I thought it would make
more sense to have a CheckBox cell for a boolean datatype, or a combobox
cell for an enumeration etc.

However, the xmlnode (extracted from the xmldocument) used to create the
row in the datagridview doesn't contain any schema information! This is
confusing me as both the XML schema and document are validated by the
application at startup. If I put a 'bad' value into an xmlnode I get a
validation error as one would expect.

Does anyone know how to match an XmlNode to it's underlying schema datatype?
 
C

Cor Ligthert[MVP]

Bubba,

Will you be so kind to set ANN: in your subject next time, now people are
opening your message several times while they think it is an unanswered
question.

(To prevent the reopening everytime as well)

Cor
 
B

Bubba

Cor said:
Bubba,

Will you be so kind to set ANN: in your subject next time, now people
are opening your message several times while they think it is an
unanswered question.

It is an unanswered question! Sorry I don't quite follow what you mean.
 
M

Martin Honnen

Bubba said:
However, the xmlnode (extracted from the xmldocument) used to create the
row in the datagridview doesn't contain any schema information! This is
confusing me as both the XML schema and document are validated by the
application at startup. If I put a 'bad' value into an xmlnode I get a
validation error as one would expect.

The SchemaInfo property
<URL:http://msdn2.microsoft.com/en-us/library/System.Xml.XmlNode.SchemaInfo.aspx>
should help. If not then please show us your code setting up the
XmlDocument, if you use an XmlReader with the proper XmlReaderSettings
passed to the Load method then the DOM nodes should have schema info
associations.
 
B

Bubba

Bubba said:
Hi All,

I'm presently populating a DataGridView with data extracted from an XML
file, but since there is a range of datatypes I thought it would make
more sense to have a CheckBox cell for a boolean datatype, or a combobox
cell for an enumeration etc.

However, the xmlnode (extracted from the xmldocument) used to create the
row in the datagridview doesn't contain any schema information! This is
confusing me as both the XML schema and document are validated by the
application at startup. If I put a 'bad' value into an xmlnode I get a
validation error as one would expect.

Does anyone know how to match an XmlNode to it's underlying schema
datatype?

Hi I've managed to fix this, I was using a bad XPath.

Thanks for your help.
 
C

Cor Ligthert[MVP]

Bubba,

My excuse, I was writing this, however added it to your message.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top