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 Andreas Pfeifer <An...@jena-optronik.de> on 2005/10/20 20:56:32 UTC
"Expected comment or processing instruction" error while running
memparse
Hi there,
like mentioned above, I get an SAXParseException when I try to parse
following xml-code with the memparse - example:
<?xml version="1.0" encoding='iso-8859-1' ?>
<ITEM_DEFINITION_FILE
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ITEM_DEFINITION_FILE.xsd">
<RECORD Access="MPH" Filename="Mph"/>
<RECORD Access="SPH" Filename="Sph"/>
<RECORD Access="IPR" AccessSpec="LOOP" Filename="Ipr1a" Counter="-1"/>
<RECORD Access="GEADR" AccessSpec="LOOP" Filename="Geadr1a" Counter="-1"/>
<RECORD Access="GIADR" AccessSpec="BANDS" Filename="Giadr1aBands"/>
<RECORD Access="GIADR" AccessSpec="STEPS" Filename="Giadr1aSteps"/>
<RECORD Access="GIADR" AccessSpec="MME" Filename="Giadr1aMME"/>
<RECORD Access="GIADR" AccessSpec="CHANNELS" Filename="Giadr1aChannels"/>
<RECORD Access="GIADR" AccessSpec="LOOP" Filename="Giadr1a" Counter="-1"/>
<RECORD Access="VEADR" AccessSpec="LOOP" Filename="Veadr1a" Counter="-1"/>
<RECORD Access="VIADR" AccessSpec="LOOP" Filename="Viadr1a" Counter="-1"/>
<RECORD Access="MDR" AccessSpec="LOOP" Filename="Mdr1a" Counter="-1"/>
</ITEM_DEFINITION_FILE>
The error description message also tells me, that the exception occurs
on the last line.
Hmmm... I can't see anything wrong there?!
Thanks in advance -> Andi
Re: "Expected comment or processing instruction" error while running
memparse
Posted by Andreas Pfeifer <An...@jena-optronik.de>.
Woops.
My buffer for the file I was reading in had exactly the length the files
length. No chance for NULL termination. Fixed this -> works.
Thanks for your help :) -> Andi
Re: "Expected comment or processing instruction" error while
running memparse
Posted by Alberto Massari <am...@datadirect.com>.
Hi Andreas,
the error means that Xerces found data after the closing tag
</ITEM_DEFINITION_FILE>; as you are feeding the data using
MemBufferInputSource, have you checked whether your data is NULL
terminated and you have reported the correct length?
Alberto
At 20.56 20/10/2005 +0200, Andreas Pfeifer wrote:
>Hi there,
>
>like mentioned above, I get an SAXParseException when I try to parse
>following xml-code with the memparse - example:
>
><?xml version="1.0" encoding='iso-8859-1' ?>
><ITEM_DEFINITION_FILE
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>xsi:noNamespaceSchemaLocation="ITEM_DEFINITION_FILE.xsd">
> <RECORD Access="MPH" Filename="Mph"/>
> <RECORD Access="SPH" Filename="Sph"/>
> <RECORD Access="IPR" AccessSpec="LOOP" Filename="Ipr1a"
> Counter="-1"/>
> <RECORD Access="GEADR" AccessSpec="LOOP" Filename="Geadr1a"
> Counter="-1"/>
> <RECORD Access="GIADR" AccessSpec="BANDS" Filename="Giadr1aBands"/>
> <RECORD Access="GIADR" AccessSpec="STEPS" Filename="Giadr1aSteps"/>
> <RECORD Access="GIADR" AccessSpec="MME" Filename="Giadr1aMME"/>
> <RECORD Access="GIADR" AccessSpec="CHANNELS"
> Filename="Giadr1aChannels"/>
> <RECORD Access="GIADR" AccessSpec="LOOP" Filename="Giadr1a"
> Counter="-1"/>
> <RECORD Access="VEADR" AccessSpec="LOOP" Filename="Veadr1a"
> Counter="-1"/>
> <RECORD Access="VIADR" AccessSpec="LOOP" Filename="Viadr1a"
> Counter="-1"/>
> <RECORD Access="MDR" AccessSpec="LOOP" Filename="Mdr1a"
> Counter="-1"/>
></ITEM_DEFINITION_FILE>
>
>The error description message also tells me, that the exception
>occurs on the last line.
>
>Hmmm... I can't see anything wrong there?!
>
>Thanks in advance -> Andi
>
>
>
>
>