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. getting location of schema used

getting location of schema used

Scheduled Pinned Locked Moved C#
xmldatabaseregex
1 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.
  • J Offline
    J Offline
    James McCutcheon
    wrote on last edited by
    #1

    I load in an xml document and validate it ... ok thats the easy part XmlDocument doc = new XmlDocument(); XmlTextReader tr = new XmlTextReader("Sample.xml"); XmlValidatingReader reader = new XmlValidatingReader(tr); doc.Load(reader); there might be several schemas that are used to validate, their location is specified via the xml schemalocation attribute. Now if I want a table of those locations i presently read and parse the location attribute and manually match up the namespace prefix with the location file via the namespace URI. So i can go and physically read in the validating schemas. XmlNode myNode = oc.SelectSingleNode("//instance:group",xmlnsmgr); XmlNodeReader myreader = new XmlNodeReader(myNode); myreader.Read(); myreader.MoveToAttribute("schemaLocation",this.xml_schema_ns); String[] schemalist = myreader.Value.Split(new char[] {' '}); The must be a simplier way I dont know about, please if anybody knows can the enlighten me. Thanks in Advance James

    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