Mapping validation error to DOM document

admin

Administrator
Staff member
When using the .NET ValidatingReader functionality you can get an error listofinvalid xml lines or a schema exception, according to the schema . Both ofthese give you the element name and the line number and position e.g. Line56, Column 4, MyNameSpace:LastName.I want to be able to map this error data, in code, back to the xml beingvalidated. Now i cannot see a method within the .NET class libaries ofsayingsomething like MoveToElement(LinePos,CharPos) or indeed a way of usingXPath.The XmlTextReader does have a LineNumber and LinePosition property but theseare RO. I could use the XmlDocument's SelectNodes to find all the occurencesof the element named in the error but the node classes returned do notexpose line or char postion info.Does anyone have any ideas?ThanksPat Long
 
Back
Top