Re: XML Parser in EVC++ 4.0



Excuse me can you give me some example for read my file XML with SAX
parser in EVC++ ?

My file :

<?xml version="1.0" standalone="yes"?>
<Impianti>
<Impianto Impianto_Id="1">
<Nome>Impianto 1</Nome>
<Avaria Impianto_Id="1" Identificativo="1">
<Descrizione>Descrizione 1</Descrizione>
<Guida>Guida 1</Guida>
</Avaria>
<Avaria Impianto_Id="1" Identificativo="2">
<Descrizione>Descrizione 2</Descrizione>
<Guida>Guida 2</Guida>
</Avaria>
</Impianto>
<Impianto Impianto_Id="2">
<Nome>Impianto 2</Nome>
<Avaria Impianto_Id="2" Identificativo="1">
<Descrizione>Descrizione 1</Descrizione>
<Guida>Guida 1</Guida>
</Avaria>
<Avaria Impianto_Id="2" Identificativo="2">
<Descrizione>Descrizione 2</Descrizione>
<Guida>Guida 2</Guida>
</Avaria>
</Impianto>
</Impianti>


Dan McCarty ha scritto:

Hi John,

The exceptions we were seeing were actually reported to us by a
customer. After a site survey the data being returned by an internal
XML page contained invalid characters from the SSID names--e.g.,
"<MY_AP!>". While we were able to code a work-around on our homebrew
parser, the customer, who was using the MSXML parser, would see a
general exception. Unfortunately, I never saw any of the error logs or
specifics, so I can't give you any more details than that.

-Dan.


John Spaith [MS] wrote:
Dan, could you please let me know where XML can bomb on invalid XML or what
you mean by that? Do you mean that it just fails to keep parsing the data
(in which case that's what it should be doing :)) or do you mean it crashes
on you (and not just the spurios messages about it throwing exceptions
(http://www.pocketpcdn.com/articles/xmlfaq.html or the bug in EVC where EVC
hangs (http://blogs.msdn.com/cenet/archive/2005/07/27/444077.aspx) when
MSXML hits an error, which wouldn't affect retail devices). If it is
something I'm not aware of I would like to know so we can address this.

If you really want to be able to parse any garbage XML thrown at you (or as
far as you can), you could try using SAX. It will keep parsing and caller
your sax handler till it hits the error (in which case it too will stop its
parsing).

--
John Spaith
Development Lead, Windows CE
Microsoft Corporation

Check out the CE Networking Team Blog at http://blogs.msdn.com/cenet/.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2006 Microsoft Corporation. All rights
reserved.

"Dan McCarty" <dmccarty@xxxxxxxxx> wrote in message
news:1163627484.679685.135650@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The MSXML parser can also bomb on invalid XML (e.g., special characters
not escaped), whereas if you have the source to your own parser you can
compensate with invalid parsing. ;-)

Dan, speaking from experience, unfortunately.

.



Relevant Pages

  • Re: torture
    ... If you're using Java 1.4 then you already have an XML parser built in to ... manipulable object representation of the XML document in memory. ... The SAX API works by reading the document and generating callbacks to ...
    (comp.lang.java.programmer)
  • Re: XmlTextreader versus DOM
    ... I've heard them referred to as "DOM" and "SAX". ... DOM is, generally speaking, the easiest way in which to deal with XML ... "SAX" (named after the original parser, I think) parsers read one XML ...
    (microsoft.public.dotnet.xml)
  • Re: [PHP] Good XML Parser
    ... So if I'm looking to parse certain attributes out of an XML tree, ... XML parsers fall into two general camps - DOM and SAX. ... If you just need the data, a SAX parser will probably do everything ...
    (php.general)
  • Re: XmlTextreader versus DOM
    ... I've heard them referred to as "DOM" and "SAX". ... DOM is, generally speaking, the easiest way in which to deal with XML ... "SAX" (named after the original parser, I think) parsers read one XML ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Word 2003 XML
    ... In essence the parser determines whether the XML provided to it, ... have much info. about the schemas associated with an XML document. ... (which is what namespaces are all about). ...
    (microsoft.public.mac.office.word)

Loading