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 "Martin V." <fa...@hotmail.com> on 2001/05/01 18:00:22 UTC

Maybe Domstring bug ???

HI,

I use Linux Slackware 7.1 with kernel 2.4.4
platform i686

and my locale setting are :
   setenv LC_CTYPE ISO-8859-1
   setenv LANG fr_CA

Xerces ver 1.4 for Unix system

When I parse a xml file with SAX tool it works good and
it take all the latin accents(é,etc..), cool !!!

When I want to do the inverse way (data get from sax to XML)
I use DOM tree so I put the data ( char*) containing French accents
like : 
MapElem.appendChild(doc.createTextNode(thisMap->mapit(keyname).c_str()));

It' work ok if my string don't contains latin accents,
but if I put only 1 or more accents in the string wherever the position of 
the accent, the rawBuffer of this Domstring return 0
and the length function return 0 too.

PS: I checked the string just before insertion in DOMstring object
and it's ok (containing accents)

So when I use accents in Domstring, it dumps the entire string

could you please help me!!!

there's a copy of my xml readed by SAX
and the data still good till I put it in DOMstring

<?xml version="1.0" encoding="ISO-8859-1"?>
<TEST>
<CFG id="DEBUG_LEVEL">5</CFG>
<CFG id="SECURITY_LEVEL">1</CFG>
<CFG id="LOG_ACTIVITY_LEVEL">4</CFG>
<CFG id="RANDOM_HOMEPAGE">N</CFG>
<CFG id="HOMEPAGE_NUM_ITEMS">9</CFG>
<CFG id="W_CREDIT_CARD"><EN>Credit Card</EN><FR>Carte de crédit</FR></CFG>
<CFG id="W_ORDER_COMPLETED"><EN>This order is completed.</EN><FR>Cette 
commande a été traitée et complétée.</FR></CFG>
</TEST>

DTD file :
<?xml encoding="ISO-8859-1"?>
<!ELEMENT TEST (CFG)+>
<!ELEMENT CFG (#PCDATA|EN|FR|ES)*>
<!ATTLIST CFG id ID #REQUIRED>
<!ELEMENT EN (#PCDATA)>
<!ELEMENT FR (#PCDATA)>
<!ELEMENT ES (#PCDATA)>

please give me an answer
THANKS  Martin
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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


Re: Maybe Domstring bug ???

Posted by Curt Arnold <ca...@houston.rr.com>.
My guess would be that it was actually in the transcoding of your char* to
XMLCh* before
the creation of the DOMString.

If the transcoder used in the conversion was, for example, UTF-8, then I
would expect you would either get an exception or, at least, unusual
behavior.  You may need to set the transcoder used to
convert char* to XMLCh* to be an ISO 8859-1 converter.

Hopefully, that give you enough to track down the issue, don't have the code
handy.


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