Hi Javier,
Javier Gálvez Guerrero wrote:
Hi there.
Now I can compile the source code file where I have implemented (or tried
it...) the DOM parser, some errors have appeared. As they seem quite simple
I hope you could help me again:
The method in file.cpp is like this (I have followed the guidelines
<http://xerces.apache.org/xerces-c/program-dom.html>on Xerces site, except
for the exception treatment...):
void contents_manager::load_guide(String^ xml_path){
XMLPlatformUtils::Initialize();
XercesDOMParser* parser = new XercesDOMParser();
parser->parse(xml_path);
DOMNode* root = parser->getDocument(); //child_aux1 will be the first
child of root
DOMNode* child_aux1, child_aux2, child_aux3, child_aux4, child_aux5,
child_aux6, child_aux7; // Compiling errors referring to this line
You are missing the '*' for the variables after child_aux1; the correct
declaration is
DOMNode* child_aux1, *child_aux2, *child_aux3, *child_aux4, *child_aux5,
*child_aux6, *child_aux7;
[..]
By the way, as you may have seen on the arguments of my method, the
name/path of the XML file is received with String^ type, so, as I need to
have a char* as an argument for parse->parse(file_name), how can I parse it?
See http://support.microsoft.com/kb/311259
Alberto
2007/11/28, Sven Bauhan <[EMAIL PROTECTED]>:
This is not true. std::string and UTF-8 are fully compatible, as long
as
you make no assumptions about chopping things up at arbitrary indices,
or
the relationship of Unicode code points and UTF-8 code units. At any
rate,
with a double-byte or multi-byte locale code page, you'd have the same
issues.
I do not really understand what you want to say here. As far as I know
std::string stores strings in single byte units. In UTF-8 the units have
variable length between 1 and 4 bytes. So I cannot see a match here.
I thought to use UTF-8 with the STL you need something like
std::basic_string<UTFChar>.
Could you tell me, how to transcode the XMLChar* correctly using UTF-8?
Sven