You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Amato, Matt" <ma...@stk.com> on 2001/06/01 22:13:49 UTC

Parsing XML in the middle of a file text file...

	I have a problem in that I have to parse XML that is located in the
middle of a text file.  I am handed a file ptr who's current position is the
beginning of the XML section.  The parser will read in the data and parse it
fine until it hits past the end of the XML and the starts to try and parse
the non XML data in the file.  At this point it throws an exception and
gives me an error.  Is there anyway for me to tell the parser to stop
parsing after it's done with the root element.  Or has anyone else had this
kind of problem and knows the best way to handle it?

	Thanks,
		Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Parsing XML in the middle of a file text file...

Posted by Dean Roddey <dr...@charmedquark.com>.
You would have to write your own InputSource and BinInStream derivatives.
Look at how LocalFileInputSource and BinFileInStream work together. If you
write your own derivatives, you can control how the input gets fed to the
parser.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Why put off until tomorrow what you can
put off until the day after tomorrow?"

----- Original Message -----
From: "Amato, Matt" <ma...@stk.com>
To: <xe...@xml.apache.org>
Sent: Friday, June 01, 2001 1:13 PM
Subject: Parsing XML in the middle of a file text file...


>
> I have a problem in that I have to parse XML that is located in the
> middle of a text file.  I am handed a file ptr who's current position is
the
> beginning of the XML section.  The parser will read in the data and parse
it
> fine until it hits past the end of the XML and the starts to try and parse
> the non XML data in the file.  At this point it throws an exception and
> gives me an error.  Is there anyway for me to tell the parser to stop
> parsing after it's done with the root element.  Or has anyone else had
this
> kind of problem and knows the best way to handle it?
>
> Thanks,
> Matt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org