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 Gianmario Tartaglione <gi...@dp2000.it> on 2005/03/10 17:05:34 UTC
Problem with xerces 2.2.0 when read ascii value greater 127
(HP-UX works; LINUX dosen't work)
Hi,
I'm using xerces 2.2.0 and I have a little problem in read xml value with
ascii value greater 127.
XML file example
-----------------------------
<?xml version="1.0" encoding="UTF-16"?>
<!-- TAPI configuration parameters -->
<!DOCTYPE doc [
<!ENTITY dirroot "/tms/RUNTIME/APP_WIND/HTS3/NORMALIZER/POP_WPOP/" >
<!ENTITY dircommoncfg "/tms/RUNTIME/APP_WIND/HTS3/NORMALIZER/cfg/" >
<!ENTITY dircfg
"/tms/RUNTIME/APP_WIND/HTS3/NORMALIZER/POP_WPOP/cfg/" >
<!ENTITY concurrencecfg
"/tms/RUNTIME/APP_WIND/HTS3/concurrence_cfg/" >]>
<ParamDefinition>
<ParamSection PSName="OUTPUT">
<ParamInfo
PIName="OUTPUT_DIR" PIValue="&dirroot;output"
PIComment="Output
Directory" PIValidation="EXIST_DIR"/>
<ParamInfo
PIName="FILE_RECORD_DESC" PIValue="&dircfg;ascii_POP_WPOP_output.xml"
PIComment="xml decription record output
file" PIValidation="EXIST_FILE"/>
<ParamInfo
PIName="FIELD_SEPARATOR" PIValue="¦"
PIComment="separator field char into output record"
PIValidation="NOT_NULL"/>
</ParamSection>
</ParamDefinition>
The problem is in the attribute value PIValue="¦".
In HP-UX environment the parser works correctly.
In LINUX environment the parser dosen't work correctly. (The value readed
is "" empty string).
The handler code of the SAX2 parser is about:
class XCP_CParserXmlData_ParamTableHandler : public DefaultHandler
{
void startElement( const XMLCh* const pobjURI, const XMLCh* const
pobjLocalname, const XMLCh* const pobjQname, const Attributes& robjAttrs );
void endElement( const XMLCh* const pobjURI, const XMLCh* const
pobjLocalname, const XMLCh* const pobjQname );
void endDocument( );
}
void XCP_CParserXmlData_ParamTableHandler::startElement(const XMLCh* const
pobjURI
, const XMLCh* const pobjLocalname
, const XMLCh* const pobjQname
, const Attributes& robjAttrs)
{
XERCESUTIL_CXStr tobjXAttrName( );
XERCESUTIL_CXStr tobjXString( );
tobjXAttrName = XCP_TAG_PIVALUE;
tobjXString = robjAttrs.getValue( pobjURI, (const XMLCh *)
tobjXAttrName );
}
XERCESUTIL_CXStr is a utility class that convert a const XMLCh * to string
I debugged both version (HP-UX and LINUX). In the first case (HP-UX) i saw
that into tobjXString there was the correct value, in the second case into
tobjXString there was empty string.
Why in LINUX environment it dosen't work?? What i miss??
I Hope that the informations are enough.
Thanks a lot
Best Regards
Gianmario
______________________________________
Tartaglione Gianmario
cell. : +39 348 5267783
Tel. : +39 0187 599.603
Fax: : +39 0187 563.634
e-mail: gianmario.tartaglione@dp2000.it
Delta Progetti 2000 S.r.l.
Sede Legale: Via Fontevivo 25, 19125 La Spezia
Italy
www.dp2000.it
_______________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Problem with xerces 2.2.0 when read ascii value greater 127 (HP-UX works; LINUX dosen't work)
Posted by Gareth Reakes <ga...@parthenoncomputing.com>.
Hey,
You are converting to local code page by using CXStr (I assume its a
copy of the macros from the samples). Are you sure that your 2
platforms have the same code page? To test if this is the case,
navigate to the attribute in the DOM and look at the length of the
string in the attribute for both platforms. I would expect them to be
the same.
Cheers,
Gareth
On 10 Mar 2005, at 16:05, Gianmario Tartaglione wrote:
>
>
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org