You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Sami Islam <sa...@detewe.de> on 2004/04/27 09:16:47 UTC
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: sami.islam@detewe.de
Re: AW: AW: How come there is no conversion from XalanDOMString to char*?
Posted by Soheila Bashardoust-Tajali <st...@ca.ibm.com>.
Sami,
You can find the definition of this c_str(...) inline function in:
<xalanc/PlatformSupport/DOMStringHelper.hpp>
Hope this can help.
Soheila
"Sami Islam" <sa...@detewe.de>
04/27/2004 11:09 AM
Please respond to
xalan-c-users
To
<xa...@xml.apache.org>
cc
Subject
AW: AW: How come there is no conversion from XalanDOMString to char*?
Soheila,
Where are you getting c_str( ) from?
Sami
-----Ursprüngliche Nachricht-----
Von: Soheila Bashardoust-Tajali [mailto:stajali@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:41
An: xalan-c-users@xml.apache.org
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" <sa...@detewe.de>
04/27/2004 10:34 AM
Please respond to
xalan-c-users
To
<xa...@xml.apache.org>
cc
Subject
AW: 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:mhoyt@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:01
An: xalan-c-users@xml.apache.org
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"
<sami.islam@detew
e.de>
To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de
AW: AW: How come there is no conversion from XalanDOMString to char*?
Posted by Sami Islam <sa...@detewe.de>.
Soheila,
Where are you getting c_str( ) from?
Sami
-----Ursprüngliche Nachricht-----
Von: Soheila Bashardoust-Tajali [mailto:stajali@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:41
An: xalan-c-users@xml.apache.org
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" <sa...@detewe.de>
04/27/2004 10:34 AM
Please respond to
xalan-c-users
To
<xa...@xml.apache.org>
cc
Subject
AW: 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:mhoyt@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:01
An: xalan-c-users@xml.apache.org
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"
<sami.islam@detew
e.de>
To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de
Re: AW: AW: How come there is no conversion from XalanDOMString to char*?
Posted by da...@us.ibm.com.
Hi Sami,
Please do not post rich-text and graphical images to this new group. There
will be subscribers who will want to follow the conversation, and even
reply, but will not be able to because your posting will not be readable
for them.
Your problem is you are not linking your project correctly. Please make
sure you are building using the Multithreaded DLL runtime libraries. For a
debug release, use the Debug Multithreaded DLL runtime, and for a release
build, use the Multithreaded DLL runtime. You can find out how to do this
by looking at the documentation for whatever version of Visual Studio
you're using.
Dave
|---------+--------------------------->
| | "Sami Islam" |
| | <sami.islam@dete|
| | we.de> |
| | |
| | 04/27/2004 08:39|
| | AM |
| | Please respond |
| | to xalan-c-users|
|---------+--------------------------->
>------------------------------------------------------------------------------------------------------------------------------------------|
| |
| To: <xa...@xml.apache.org> |
| cc: (bcc: David N Bertoni/Cambridge/IBM) |
| Subject: AW: AW: How come there is no conversion from XalanDOMString to char*? |
>------------------------------------------------------------------------------------------------------------------------------------------|
Hello,
This is my code:
*******************************************************************************************
for(size_t i=0; i<numNodes; ++i)
{
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));
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:stajali@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:41
An: xalan-c-users@xml.apache.org
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"
<sa...@detewe.de>
To
04/27/2004 10:34 AM <xa...@xml.apache.org>
cc
Please respond to Subject
xalan-c-users AW: 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:mhoyt@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:01
An: xalan-c-users@xml.apache.org
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"
<sami.islam@detew
e.de>
To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de
AW: AW: How come there is no conversion from XalanDOMString to char*?
Posted by Sami Islam <sa...@detewe.de>.
Hello,
This is my code:
************************************************************************
*******************
for(size_t i=0; i<numNodes; ++i)
{
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));
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:stajali@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:41
An: xalan-c-users@xml.apache.org
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" <sa...@detewe.de>
04/27/2004 10:34 AM
Please respond to
xalan-c-users
To
<xa...@xml.apache.org>
cc
Subject
AW: 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:mhoyt@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:01
An: xalan-c-users@xml.apache.org
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"
<sami.islam@detew
e.de>
To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de
Re: AW: How come there is no conversion from XalanDOMString to char*?
Posted by Soheila Bashardoust-Tajali <st...@ca.ibm.com>.
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" <sa...@detewe.de>
04/27/2004 10:34 AM
Please respond to
xalan-c-users
To
<xa...@xml.apache.org>
cc
Subject
AW: 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:mhoyt@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:01
An: xalan-c-users@xml.apache.org
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"
<sami.islam@detew
e.de>
To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de
Re: AW: How come there is no conversion from XalanDOMString to char*?
Posted by Matthew Hoyt <mh...@ca.ibm.com>.
Sami,
samples/XPathWrapper shows an example of using TranscodeToLocalCodePage.
-Matt.
"Sami Islam"
<sami.islam@detew
e.de> To
<xa...@xml.apache.org>
04/27/2004 10:34 cc
AM
Subject
AW: How come there is no conversion
Please respond to from XalanDOMString to char*?
xalan-c-users
Are there any examples out there?
Regards,
Sami
-----Ursprüngliche Nachricht-----
Von: Matthew Hoyt [mailto:mhoyt@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:01
An: xalan-c-users@xml.apache.org
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"
<sami.islam@detew
e.de>
To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de
AW: How come there is no conversion from XalanDOMString to char*?
Posted by Sami Islam <sa...@detewe.de>.
Are there any examples out there?
Regards,
Sami
-----Ursprüngliche Nachricht-----
Von: Matthew Hoyt [mailto:mhoyt@ca.ibm.com]
Gesendet: Dienstag, 27. April 2004 16:01
An: xalan-c-users@xml.apache.org
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"
<sami.islam@detew
e.de>
To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de
Re: How come there is no conversion from XalanDOMString to char*?
Posted by Matthew Hoyt <mh...@ca.ibm.com>.
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"
<sami.islam@detew
e.de> To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de
Re: How come there is no conversion from XalanDOMString to char*?
Posted by Dmitry Hayes <dm...@ca.ibm.com>.
Hi Sami!
XalanDOMString is designed to contain UTF16 string . To be more explicit ,
it contains an array of UCS-2 code points.
You can use CharVectorType when you want to represent UTF-8 strings.
Note that you can't represent every code point of UTF-16 as simply C/C++
"char" .
Dmitry
"Sami Islam"
<sami.islam@detew
e.de> To
"Xalan User List"
04/27/2004 03:16 <xa...@xml.apache.org>,
AM "Xalan Dev List"
<xa...@xml.apache.org>
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: sami.islam@detewe.de