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 Magnus Karlsson <ma...@transrail.se> on 2003/10/23 10:05:25 UTC

Error parsing TEXT_NODE containing ´<´ and ´>´

Hi!

I have build Parser for a file, containing SQL commands. The problem is that
a SQL command can contain ‘<’ and ‘>’, i.e.

SELECT ID, NAME FROM SOME_TABLE WHERE INT_COLUMN >= ? OR INT_COLUMN <= ?

When I parse the file I get an parser exception:

DOMError FATAL ERROR message: Expected an element name

Is there any way to get around this problem? I tried to put an escape
character before ‘<’ and ‘>’, i.e.

SELECT ID, NAME FROM SOME_TABLE WHERE INT_COLUMN \>= ? OR INT_COLUMN \<= ?

But this did not help.

Many thanks in advance
Magnus Karlsson


Re: Error parsing TEXT_NODE containing ´ <´ and ´ >´

Posted by Alberto Massari <am...@progress.com>.
At 10.05 23/10/2003 +0200, Magnus Karlsson wrote:
>Hi!
>
>I have build Parser for a file, containing SQL commands. The problem is 
>that a SQL command can contain '<' and '>', i.e.
>
>SELECT ID, NAME FROM SOME_TABLE WHERE INT_COLUMN >= ? OR INT_COLUMN <= ?
>
>When I parse the file I get an parser exception:
>
>DOMError FATAL ERROR message: Expected an element name
>
>Is there any way to get around this problem? I tried to put an escape 
>character before '<' and '>', i.e.
>
>SELECT ID, NAME FROM SOME_TABLE WHERE INT_COLUMN \>= ? OR INT_COLUMN \<= ?

The correct way to escape '<' and '>' in an XML file is to use &lt; and &gt;

Alberto 



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