Thanks for the reply.
Is there also the possbility to get a pointer to the current node from the
XmlReader class? I would then store those pointers in a collection and after
having parsed the whole Xml file walk through the entries in my collection
and add <resulttags with detailed information right after the Nodes
specified in my collection.
Thanks,
Martin
"Martin Honnen" <ma*******@yahoo.deschrieb im Newsbeitrag
news:uR**************@TK2MSFTNGP06.phx.gbl...
Martin Eckart wrote:
>I have an XML Schema and I am validation many XML files against the
schema. If successful, the files get transferred to another location. If
not, then I would like to add an error tag right after the corresponding
XmlNode (in the next line) specifying the error message.
I am currently validating using an XMLReader with XMLReaderSettings. I
have tried with a EventHandler for the Validation Errors or Warnings, but
don't get the current node I am in here. Another try was using the catch
block to get the element and/or attribute name of the error node. This
works, but then the reader does not advance anymore, since I had an
exception...
XmlNode is an abstract class for the .NET DOM implementation. XmlReader is
independent of the DOM implementation, it is a fast, forwards only pull
parser. If you are using XmlReader and a ValidationEventHandler then you
can cast the sender object to the XmlReader and access the reader
properties like NodeType or Name.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/