Hello,
This
is my code:
*******************************************************************************************
for(size_t i=0; i<numNodes;
++i)
{
XalanNode* const node = theNodeList.item(i);
XalanDOMString str;
{
XalanNode* const node = theNodeList.item(i);
XalanDOMString str;
const int theType =
node->getNodeType();
if (theType ==
XalanNode::COMMENT_NODE ||
theType == XalanNode::PROCESSING_INSTRUCTION_NODE)
str = node->getNodeValue();
else if (theType == XalanNode::ELEMENT_NODE)
str = node->getNodeName();
else
DOMServices::getNodeData(*node, str);
const CharVectorType localCharVec(TranscodeToLocalCodePage(str));
theType == XalanNode::PROCESSING_INSTRUCTION_NODE)
str = node->getNodeValue();
else if (theType == XalanNode::ELEMENT_NODE)
str = node->getNodeName();
else
DOMServices::getNodeData(*node, str);
const CharVectorType localCharVec(TranscodeToLocalCodePage(str));
cout <<
&*localCharVec.begin();
}
******************************************************************************************
In
debug mode when I step over the line
const
CharVectorType localCharVec(......)... I get a "User Defined
Breakpoint".
When I
run the program I get this error dialog
What
am I doing wrong? I don't get the error when I run the sample XPathWrapper
program.
Sami
-----Urspr�ngliche Nachricht-----
Von: Soheila Bashardoust-Tajali [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 27. April 2004 16:41
An: [email protected]
Betreff: Re: AW: How come there is no conversion from XalanDOMString to char*?
Sami,
For converting XalanDOMString type to char* type, you should do these two conversions:
-conversion from UTF-16 to UTF-8
CharVectorType your-target-vector;
TranscodeToLocalCodePage( const XalanDOMString& your-string, your-target-vector, false);
-conversion from UTF-8 to char*
const char* const your-charp = c_str(your-target-vector);
you can manipulate your-target-vector char by char then.
Soheila
"Sami Islam" <[EMAIL PROTECTED]> 04/27/2004 10:34 AM
Please respond to
xalan-c-users
To<[email protected]> cc SubjectAW: How come there is no conversion from XalanDOMString to char*?
Are there any examples out there?
Regards,
Sami
-----Urspr�ngliche Nachricht-----
Von: Matthew Hoyt [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 27. April 2004 16:01
An: [email protected]
Betreff: Re: How come there is no conversion from XalanDOMString to
char*?
XalanDOMString are made of XalanDOMChars. XalanDOMChar is defined as a
wide char (in xalanc/Include/PlatformDefinitions.hpp) for UTF-16
encoding.
Look at XalanDOMString::transcode method and the
TranscodeToLocalCodePage function to convert a XalanDOMString to a
CharVectorType.
-Matt.
"Sami Islam"
<[EMAIL PROTECTED]
e.de>
To
"Xalan User List"
04/27/2004 03:16 <[email protected]>,
AM "Xalan Dev List"
<[email protected]>
cc
Please respond to
xalan-c-users
Subject
How come there is no conversion
from XalanDOMString to char*?
Hello,
I would like to print out the result of a Xpath evaluation.
I see that I have to convert the XalanDOMString to CharVectorType first
and then iterate and print out single characters. Why isn't there a
XalanDOMString member that returns a char*?
Regards,
Sami Islam
Software Entwickler
DeTeWe Informationssysteme + Consulting GmbH
Abteilung Healthcare
--
Lilienthalstrasse 5
D-30916 Isernhagen
Telefon: +49 (0)511/368499-843
Telefax: +49 (0)511/368499-88
E-mail: [EMAIL PROTECTED]
<<Outlook.bmp>>
