<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I'm currently testing XSD, but I'm having problems with special
characters: "ñ", "á",, "é", etc.<br>
<br>
I'm using a Linux Mandriva 2006.0 with xerces installed from the
package libxerces-c26-devel (xerces version 2.6.0).<br>
<br>
With this schema:<br>
<br>
<font color="blue"><?xml version="1.0" encoding="ISO-8859-1"?><br>
<xsd:schema xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified" attributeFormDefault="unqualified"><br>
<xsd:complexType name="EstadoSincronismoRequest"><br>
<xsd:sequence><br>
<xsd:element name="login" type="xsd:string"/><br>
<xsd:element name="password" type="xsd:string"/><br>
<xsd:element name="id_reclamacion" type="xsd:string"
nillable="true" minOccurs="0"/><br>
<xsd:element name="id_sistema" type="xsd:string"/><br>
<xsd:element name="fecha" type="xsd:string"
nillable="true" minOccurs="0"/><br>
<xsd:element name="telefono_red" type="xsd:string"/><br>
</xsd:sequence><br>
</xsd:complexType><br>
<xsd:element name="Peticion" type="EstadoSincronismoRequest"/><br>
</xsd:schema><br>
</font><br>
<br>
I generate the corresponding EstadoSincronismo.cxx and
EstadoSincronismo.hxx with:<br>
<font color="blue">xsd cxx-tree --generate-serialization
EstadoSincronismo.xsd</font><br>
<br>
Then I write this very simple program:<br>
<br>
<font color="blue">#include "EstadoSincronismo.hxx"<br>
#include <iostream><br>
<br>
</font><font color="blue">int<br>
main (int argc, char* argv[])<br>
{<br>
using namespace std;<br>
using namespace xercesc;<br>
<br>
auto_ptr<EstadoSincronismoRequest> unaPeticion(Peticion
(argv[1]));<br>
<br>
cerr << "login: " << unaPeticion->login() <<
endl;<br>
<br>
<b> unaPeticion->login()="acción"; // <--- _SPECIAL CHAR HERE_</b><br>
cerr << "login: " << unaPeticion->login() <<
endl;<br>
<br>
xml_schema::namespace_infomap mapeo;<br>
mapeo[""].schema="EstadoSincronismo.xsd";<br>
<br>
Peticion(cout,*unaPeticion,mapeo,"ISO-8859-1");<br>
}</font><br>
<br>
<br>
and then I compiled it with <br>
<font color="blue">g++ -g -o PetEstadoSincronismo EstadoSincronismo.cxx
main.cxx -lxerces-c</font><br>
<br>
So far, so good.<br>
<br>
But, when I run this program with a valid XML file, the field
<login> is always empty.<br>
<br>
For example, passing a file with this XML:<br>
<br>
<font color="blue"><?xml version="1.0" encoding="ISO-8859-1"
standalone="no" ?><br>
<Peticion<br>
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a><br>
xsi:noNamespaceSchemaLocation="EstadoSincronismo.xsd"><br>
<login>unLogin</login><br>
<password>laPasswd</password><br>
<id_reclamacion>24563</id_reclamacion><br>
<id_sistema>SPM</id_sistema><br>
<fecha>Las doce y cuarto</fecha><br>
<telefono_red>917429966_1</telefono_red><br>
</Peticion></font><br>
<br>
I got:<br>
<br>
<font color="blue">login: unLogin<br>
login: acción<br>
<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?><br>
<Peticion xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
xsi:noNamespaceSchemaLocation="EstadoSincronismo.xsd"><br>
<br>
<login></login><br>
<br>
<password>laPasswd</password><br>
<br>
<id_reclamacion>24563</id_reclamacion><br>
<br>
<id_sistema>SPM</id_sistema><br>
<br>
<fecha>Las doce y cuarto</fecha><br>
<br>
<telefono_red>917429966_1</telefono_red><br>
<br>
</Peticion></font><br>
<br>
<br>
The strange thing is that when I use "unaPeticion->login()" the
correct content is displayed, but when I serialize the complete class,
it keeps showing <login> empty.<br>
<br>
I tried a hundred things, but to no use: <login> keeps appearing
empty.<br>
<br>
Can someone help me, please?<br>
I've searched the docs and the mailing list, but I can't find anything.<br>
I've even searched Xerces mailing list, but I don't understand Xerces...<br>
<br>
Thanks in advance.<br>
Raúl.<br>
--<br>
P.D.: Please, excuse my English.<br>
<br>
</body>
</html>