XML problem
-
having following problem i use a xmltextreader to read a xml document. After i construct it, i create a xmlvalidating reader based on this xmltextreader. Then i create a xpathdocument on this object XmlTextReader reader = new XmlTextReader(XXX); XmlValidatingReader validatingReader = new XmlValidatingReader(reader); validatingReader.Schemas.Add(XmlSchemaCache.GetInstance().GetSchema("MYSCHEMA")); validatingReader.ValidationType = ValidationType.Schema; XmlReader readerToUse = validatingreader XPathDocument document = new XPathDocument(readerToUse ); document.createnavigator() --> here my code crashes. why? in the incoming (XXX) xml file, the default namespace is missing. Now i can't add the namespace to the file manually. So my question is now, how can i add the namespace is added to the reader, before i do document.createnavigator, without using DOM. i hope someone can help me out ;)
-
having following problem i use a xmltextreader to read a xml document. After i construct it, i create a xmlvalidating reader based on this xmltextreader. Then i create a xpathdocument on this object XmlTextReader reader = new XmlTextReader(XXX); XmlValidatingReader validatingReader = new XmlValidatingReader(reader); validatingReader.Schemas.Add(XmlSchemaCache.GetInstance().GetSchema("MYSCHEMA")); validatingReader.ValidationType = ValidationType.Schema; XmlReader readerToUse = validatingreader XPathDocument document = new XPathDocument(readerToUse ); document.createnavigator() --> here my code crashes. why? in the incoming (XXX) xml file, the default namespace is missing. Now i can't add the namespace to the file manually. So my question is now, how can i add the namespace is added to the reader, before i do document.createnavigator, without using DOM. i hope someone can help me out ;)
Com'on people, no one can help me out here?