Validating only part of XML
-
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 =]
-
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 =]
-
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 =]
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?
-
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?
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?