Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. XML problem

XML problem

Scheduled Pinned Locked Moved C#
questionxmlhelphtmldatabase
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Timothy_1982
    wrote on last edited by
    #1

    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 ;)

    T 1 Reply Last reply
    0
    • T Timothy_1982

      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 ;)

      T Offline
      T Offline
      Timothy_1982
      wrote on last edited by
      #2

      Com'on people, no one can help me out here?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups