bene
01-11-2002, 08:37 AM
Okay... XML problem.
I wrote a program for my company that creates an XML file of order information, sends it to our "sister" company, where they have a process that interprets it and loads it on their system. If data within the order itself has errors that can not load on their system, then they send me back an XML response with error information so I can display it back to the user and they fix it. Cool up to that point.
Recently, they have been changing the DTD around, which causes the actual format of the XML document to be wrong, not the data. Because of this, their interpretter picks up their error and sends me as the admin an email. This is bad because then the user is orphaned with no idea if their order was okay or not...
Okay, so my question. I am currently using the DOM to generate and interpret XML. I was wondering if anyone out their knows of a way to use the DOM to validate the XML document against a DTD before I bother sending the file. If I can catch the XML format error first, then I can send a message to the user and everyone is happy.
I know if you open the XML file in IE then it spells out DTD errors for you, but can you do it just within the DOM?
Sorry about being long winded... not sure how much background info is necessary. Also, searched for a while, but not finding anything on using the DOM for validation, so any help is HUGELY appreciated...
Thanks in advance.
Bene
I wrote a program for my company that creates an XML file of order information, sends it to our "sister" company, where they have a process that interprets it and loads it on their system. If data within the order itself has errors that can not load on their system, then they send me back an XML response with error information so I can display it back to the user and they fix it. Cool up to that point.
Recently, they have been changing the DTD around, which causes the actual format of the XML document to be wrong, not the data. Because of this, their interpretter picks up their error and sends me as the admin an email. This is bad because then the user is orphaned with no idea if their order was okay or not...
Okay, so my question. I am currently using the DOM to generate and interpret XML. I was wondering if anyone out their knows of a way to use the DOM to validate the XML document against a DTD before I bother sending the file. If I can catch the XML format error first, then I can send a message to the user and everyone is happy.
I know if you open the XML file in IE then it spells out DTD errors for you, but can you do it just within the DOM?
Sorry about being long winded... not sure how much background info is necessary. Also, searched for a while, but not finding anything on using the DOM for validation, so any help is HUGELY appreciated...
Thanks in advance.
Bene