Overview
Features
Download
Documentation
Community
Add-Ons & Services

load xml file with saxparser

Please post support and help requests here.

load xml file with saxparser

Postby dagg » 21 May 2009, 23:23

how can I do this? I've tried this but it won't work:
Code: Select all
Poco::File inputFile(location);
Poco::XML::InputSource* input=new Poco::XML::InputSource(inputFile);
parser.parse(input);


any hints?
dagg
 
Posts: 18
Joined: 28 Mar 2008, 09:07

Re: load xml file with saxparser

Postby alex » 21 May 2009, 23:28

dagg wrote:any hints?

Yes.
alex
 
Posts: 1115
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: load xml file with saxparser

Postby dagg » 22 May 2009, 08:28

alex wrote:
dagg wrote:any hints?

Yes.


I've looked at that example in 1.3.3, but argv[1] is *char, can I assume that when given a *char, it checks for location?
how does it knows to differentiate between strings and files?
dagg
 
Posts: 18
Joined: 28 Mar 2008, 09:07

Re: load xml file with saxparser

Postby alex » 22 May 2009, 14:18

dagg wrote:how does it knows to differentiate between strings and files?

Because file name is a string and file is a file. Having a file name string, you can look for the file, open and read it.

Look at EntityResolver and URIStreamOpener if you are interested in details.
alex
 
Posts: 1115
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: load xml file with saxparser

Postby dagg » 22 May 2009, 16:34

alex wrote:
dagg wrote:how does it knows to differentiate between strings and files?

Because file name is a string and file is a file. Having a file name string, you can look for the file, open and read it.

Look at EntityResolver and URIStreamOpener if you are interested in details.


that is what I'm looking for, a way to open a file and spill it into saxparser
dagg
 
Posts: 18
Joined: 28 Mar 2008, 09:07

Re: load xml file with saxparser

Postby dagg » 22 May 2009, 18:10

ok, I've tried with Poco::FileStream and it compiles, haven't tested it yet.
dagg
 
Posts: 18
Joined: 28 Mar 2008, 09:07


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest