msxml get element line / position
-
I want to be able to get the line and position of an element in a xml document, so when when there is an error (not a parse error!, but e.g. attribute verification error)I can display the user the position in the document.
-
I want to be able to get the line and position of an element in a xml document, so when when there is an error (not a parse error!, but e.g. attribute verification error)I can display the user the position in the document.
Good luck. I don't think this will be possible without custom parsing. But, who knows. Michael Flanakin Web Log
-
Good luck. I don't think this will be possible without custom parsing. But, who knows. Michael Flanakin Web Log
That's really sucks... that way there is no way of telling a user where they made the mistake... (I'm not going to do all that effort just to find a line/position).
-
That's really sucks... that way there is no way of telling a user where they made the mistake... (I'm not going to do all that effort just to find a line/position).
Actually, you might be able to rig something up. If you can cache the XML, do your value-checking, and if you find an invalid value, insert some bad XML into your cached version. Then, run a validator on that, capture the output, and voila, you should have a line number. Now, this is all just theoretical. I don't know if it's 100% possible. And, there might be something that I don't know about that would make finding the line number easier. Besides, this all seems like a lot of work for a line number. Good luck, though! Michael Flanakin Web Log
-
I want to be able to get the line and position of an element in a xml document, so when when there is an error (not a parse error!, but e.g. attribute verification error)I can display the user the position in the document.
have you tried using an xml schema..
"When the only tool you have is a hammer, a sore thumb you will have."
-
have you tried using an xml schema..
"When the only tool you have is a hammer, a sore thumb you will have."
I thought of that, but the validation of the attributes and relations is much to complex to be checked in a xml scheme.