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. XML / XSL
  4. Validating only part of XML

Validating only part of XML

Scheduled Pinned Locked Moved XML / XSL
xml
4 Posts 2 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.
  • R Offline
    R Offline
    rita_g
    wrote on last edited by
    #1

    Hello everyone =] I have xml file that contains messages I insert into MSMQ. I use XSD to validate the messages, but as expected, validation fails if any of the messages is not in the correct format, this way I lose the other valid messages. I need to work out a way to validate only one message each time and handle it in the application level. I thought about looping through all the elements in the xml and creating a new document for each message and validating it alone, but I thought I'd ask first if you guys have any other and better solutions. Thanks in advance =]

    L R 2 Replies Last reply
    0
    • R rita_g

      Hello everyone =] I have xml file that contains messages I insert into MSMQ. I use XSD to validate the messages, but as expected, validation fails if any of the messages is not in the correct format, this way I lose the other valid messages. I need to work out a way to validate only one message each time and handle it in the application level. I thought about looping through all the elements in the xml and creating a new document for each message and validating it alone, but I thought I'd ask first if you guys have any other and better solutions. Thanks in advance =]

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Welcome to Code Project :beer: What XML library are you using? Other development platform information that might be needed to help you should also be supplied.

      1 Reply Last reply
      0
      • R rita_g

        Hello everyone =] I have xml file that contains messages I insert into MSMQ. I use XSD to validate the messages, but as expected, validation fails if any of the messages is not in the correct format, this way I lose the other valid messages. I need to work out a way to validate only one message each time and handle it in the application level. I thought about looping through all the elements in the xml and creating a new document for each message and validating it alone, but I thought I'd ask first if you guys have any other and better solutions. Thanks in advance =]

        R Offline
        R Offline
        rita_g
        wrote on last edited by
        #3

        Ok, some progress. I loaded the xml, used GetElementsByTagName to find the messages nodes and iterated through each node. My problem is that GetElementsByTagName automatically adds to each node "xmlns" attribute, which makes problems later with deserialization since the automatically generated class does not contain the xmlns attribute. :S How do I prevent it from automatically showing up in each of the nodes?

        L 1 Reply Last reply
        0
        • R rita_g

          Ok, some progress. I loaded the xml, used GetElementsByTagName to find the messages nodes and iterated through each node. My problem is that GetElementsByTagName automatically adds to each node "xmlns" attribute, which makes problems later with deserialization since the automatically generated class does not contain the xmlns attribute. :S How do I prevent it from automatically showing up in each of the nodes?

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Hello again. If you don't respond to people posting replies to your questions, you won't often receive help from people on this site. You are asking yet another question and we still don't know any information about your development and runtime platforms and which XML library you are using. Shall we try this again?

          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