You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Fábio Bertinatto <be...@neteye.com.br> on 2010/03/08 18:15:56 UTC

Parse XML

Hi!

I need to parse this file (report.xml) and extract some 
information...for example, the content of <LOGDATE> 
(REQUEST>CONTENT>ACCESLOG>LOGDATE).

I have been tried do this with Libxerces but the documentation is very 
confuse for me...

Someone can help me?

Thanks

--
Fábio


RE: Parse XML

Posted by John Lilley <jl...@datalever.com>.
Its going to be hard to get started from being a "C" beginner, because Xerces is C++ and nothing is ever simple in C++.
I think starting with the DomPrint example is as easy as it gets.
Have you considered a simpler or more modern language like Java or C#?

john

-----Original Message-----
From: Fábio Bertinatto [mailto:bertinatto@neteye.com.br] 
Sent: Monday, March 08, 2010 10:44 AM
To: c-users@xerces.apache.org
Subject: Re: Parse XML

Thanks John!

I'm trying to use xerces for days..I decided use DOM, but the 
documentation is very complicate for me....

I'm a C beginner...

Can someone show a simple code?

Thanks again...

--
Fábio

On 8/3/2010 14:32, John Lilley wrote:
> "How do I get started?"
>
> First, skim through this to get some ideas:
> http://xerces.apache.org/xerces-c/faq-parse-3.html
> http://xerces.apache.org/xerces-c/program-3.html
>
> There are two main parsing interfaces, DOM and SAX.  DOM is easier to understand, it builds a tree for you representing the entire document, which you can then traverse.
>
> I would start with the DomPrint sample and understand that, then modify it to met your own needs.
>
> You might also look at tools that are designed to query XML, like XPath or XSLT:
> http://www.w3schools.com/xpath/default.asp
> http://www.w3schools.com/xsl/
>
>
> john
>
> -----Original Message-----
> From: Fábio Bertinatto [mailto:bertinatto@neteye.com.br]
> Sent: Monday, March 08, 2010 10:16 AM
> To: c-users@xerces.apache.org
> Subject: Parse XML
>
> Hi!
>
> I need to parse this file (report.xml) and extract some information...for example, the content of<LOGDATE>  (REQUEST>CONTENT>ACCESLOG>LOGDATE).
>
> I have been tried do this with Libxerces but the documentation is very confuse for me...
>
> Someone can help me?
>
> Thanks
>
> --
> Fábio
>
>    


-- 


Atenciosamente,


Fábio J. Bertinatto
NetEye Tecnologia
E-mail: bertinatto@neteye.com.br
Fone: (51) 3590-8637
Site: www.neteye.com.br


Re: Parse XML

Posted by Fábio Bertinatto <be...@neteye.com.br>.
Thanks John!

I'm trying to use xerces for days..I decided use DOM, but the 
documentation is very complicate for me....

I'm a C beginner...

Can someone show a simple code?

Thanks again...

--
Fábio

On 8/3/2010 14:32, John Lilley wrote:
> "How do I get started?"
>
> First, skim through this to get some ideas:
> http://xerces.apache.org/xerces-c/faq-parse-3.html
> http://xerces.apache.org/xerces-c/program-3.html
>
> There are two main parsing interfaces, DOM and SAX.  DOM is easier to understand, it builds a tree for you representing the entire document, which you can then traverse.
>
> I would start with the DomPrint sample and understand that, then modify it to met your own needs.
>
> You might also look at tools that are designed to query XML, like XPath or XSLT:
> http://www.w3schools.com/xpath/default.asp
> http://www.w3schools.com/xsl/
>
>
> john
>
> -----Original Message-----
> From: Fábio Bertinatto [mailto:bertinatto@neteye.com.br]
> Sent: Monday, March 08, 2010 10:16 AM
> To: c-users@xerces.apache.org
> Subject: Parse XML
>
> Hi!
>
> I need to parse this file (report.xml) and extract some information...for example, the content of<LOGDATE>  (REQUEST>CONTENT>ACCESLOG>LOGDATE).
>
> I have been tried do this with Libxerces but the documentation is very confuse for me...
>
> Someone can help me?
>
> Thanks
>
> --
> Fábio
>
>    


-- 


Atenciosamente,


Fábio J. Bertinatto
NetEye Tecnologia
E-mail: bertinatto@neteye.com.br
Fone: (51) 3590-8637
Site: www.neteye.com.br


RE: Parse XML

Posted by John Lilley <jl...@datalever.com>.
"How do I get started?"

First, skim through this to get some ideas:
http://xerces.apache.org/xerces-c/faq-parse-3.html
http://xerces.apache.org/xerces-c/program-3.html

There are two main parsing interfaces, DOM and SAX.  DOM is easier to understand, it builds a tree for you representing the entire document, which you can then traverse.  

I would start with the DomPrint sample and understand that, then modify it to met your own needs.

You might also look at tools that are designed to query XML, like XPath or XSLT:
http://www.w3schools.com/xpath/default.asp
http://www.w3schools.com/xsl/


john

-----Original Message-----
From: Fábio Bertinatto [mailto:bertinatto@neteye.com.br] 
Sent: Monday, March 08, 2010 10:16 AM
To: c-users@xerces.apache.org
Subject: Parse XML

Hi!

I need to parse this file (report.xml) and extract some information...for example, the content of <LOGDATE> (REQUEST>CONTENT>ACCESLOG>LOGDATE).

I have been tried do this with Libxerces but the documentation is very confuse for me...

Someone can help me?

Thanks

--
Fábio