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 Carlos J Aponte <ca...@us.ibm.com> on 2002/07/18 21:37:27 UTC

Parsing a tag that contains "&" with C++

I am having some problems parsing a tag using Xerces and Visual C++ 6.

The problem that I have is as follows:
I have implemented the Parser::characters method and it seems to not be
working correctly for the most part except when I have an "&amp;" within a
tag.
Ex - <test tag>H &amp; L Corp</test tag>

It will first process the tag and give me the "H", then process the tag
again and translate it to "& L Corp".
I would think it would give me the entire string ie. "H & L Corp".
If I am mistaken please let me know, or if someone can tell me how to fix
this problem or get around it I would greatly appreciate it.

Thank you in advance,

Carlos



---------------------------------------------------------------------
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 a tag that contains "&" with C++

Posted by Dean Roddey <dr...@charmedquark.com>.
The parser always stops at entity boundaries. This is its right
according to the spec. You can never assume that you will get all the
text of an element at once when using SAX.

-------------------------------------
Dean Roddey
The Charmed Quark Controller
droddey@charmedquark.com
www.charmedquark.com
 

-----Original Message-----
From: Carlos J Aponte [mailto:caponte@us.ibm.com] 
Sent: Thursday, July 18, 2002 12:37 PM
To: xerces-c-dev@xml.apache.org
Subject: Parsing a tag that contains "&amp;" with C++

I am having some problems parsing a tag using Xerces and Visual C++ 6.

The problem that I have is as follows:
I have implemented the Parser::characters method and it seems to not be
working correctly for the most part except when I have an "&amp;" within
a
tag.
Ex - <test tag>H &amp; L Corp</test tag>

It will first process the tag and give me the "H", then process the tag
again and translate it to "& L Corp".
I would think it would give me the entire string ie. "H & L Corp".
If I am mistaken please let me know, or if someone can tell me how to
fix
this problem or get around it I would greatly appreciate it.

Thank you in advance,

Carlos



---------------------------------------------------------------------
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