<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Umwandeln Xerces -Variablentyp in std::wstring]]></title><description><![CDATA[<p>Hallo,<br />
weiß nicht , ob diese Frage hier reingehört . Sie ist irgendwie Themen übergreifend <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
<p>Aus dem Xerces bekomme ich die Message als XMLch und dies möchte ich als wstring umwandeln.</p>
<p>Weiß da jemand Bescheid ?</p>
<p>Viele Grüße ,<br />
Elke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147206/umwandeln-xerces-variablentyp-in-std-wstring</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 03:46:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147206.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 May 2006 09:19:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Umwandeln Xerces -Variablentyp in std::wstring on Mon, 15 May 2006 09:19:15 GMT]]></title><description><![CDATA[<p>Hallo,<br />
weiß nicht , ob diese Frage hier reingehört . Sie ist irgendwie Themen übergreifend <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
<p>Aus dem Xerces bekomme ich die Message als XMLch und dies möchte ich als wstring umwandeln.</p>
<p>Weiß da jemand Bescheid ?</p>
<p>Viele Grüße ,<br />
Elke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057957</guid><dc:creator><![CDATA[Elke100]]></dc:creator><pubDate>Mon, 15 May 2006 09:19:15 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandeln Xerces -Variablentyp in std::wstring on Mon, 15 May 2006 09:23:05 GMT]]></title><description><![CDATA[<p>Dann schau mal nach, was für Konvertierungsmethoden die Klasse XMLch dir so bietet - eventuell ist ja etwas dabei, das einen (w)string, char* oder wchar_t* zurückgibt. (letztere können problemlos in string bzw. wstring umgewandelt werden)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1057959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057959</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 15 May 2006 09:23:05 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandeln Xerces -Variablentyp in std::wstring on Mon, 15 May 2006 09:58:25 GMT]]></title><description><![CDATA[<p>Bei meinen letzten Experimenten damit hat sich ergeben dass XMLCh und wchar_t äquivalent sind, und die transcode-Funktionen von Xerces bieten auch nur Konvertierungen char&lt;-&gt;XMLCh, nicht wchar_t&lt;-&gt;XMLCh... Seinerzeit ist bei mir folgende Klasse herausgekommen, die ich als Adapter zwischen wstring, char* und XMLCh* genommen habe:</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;iostream&gt;

#include &lt;xercesc/util/XMLChar.hpp&gt;

namespace xml {

    class string: public std::basic_string&lt;XMLCh&gt;
    {
        typedef std::basic_string&lt;XMLCh&gt; base_type;

    public:
        string(const char* data);
        // constructs an xml string from a transcoded C-string

        template&lt;typename Ty&gt;
        string(const Ty&amp; data): base_type( data ) {}
        // constructs an xml string from any data base_type can handle

        template&lt;typename InIt&gt;
        string(InIt first, InIt last): base_type( first, last ) {}
        // constructs an xml string from any range base_type can handle

        friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const string&amp; arg);
        // transcodes the stored data to C-string and streams it to os
    };

    string::string(const char* data)
    {
        XMLCh* transcoded = XMLString::transcode(data);
        *this = transcoded;
        XMLString::release(&amp;transcoded);
    }

    ostream&amp; operator&lt;&lt;(ostream&amp; os, const string&amp; arg)
    { 
        char* transcoded = XMLString::transcode(arg.c_str());
        os &lt;&lt; transcoded;
        XMLString::release(&amp;transcoded);
        return os; 
    }

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1057984</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1057984</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Mon, 15 May 2006 09:58:25 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandeln Xerces -Variablentyp in std::wstring on Mon, 15 May 2006 10:37:15 GMT]]></title><description><![CDATA[<p>Hallo CStoll,</p>
<p>ich habe genau wie LordJaxom feststellen müssen , dass es keine Konvertierung in wstring gibt.</p>
<p>Hallo LordJaxom ,</p>
<p>habe deinen Code angeschaut und leider nicht gefunden , wo du XMLCh in wstring konvertierst.</p>
<p>XMLCh einfach casten in wstring geht nicht . Habe schon versucht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":-("
      alt="😞"
    /></p>
<p>Viele Grüße,<br />
Elke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058006</guid><dc:creator><![CDATA[Elke100]]></dc:creator><pubDate>Mon, 15 May 2006 10:37:15 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandeln Xerces -Variablentyp in std::wstring on Mon, 15 May 2006 10:46:07 GMT]]></title><description><![CDATA[<p>Das widerum funktioniert bei mir (jedenfalls compiliert es durch):</p>
<pre><code class="language-cpp">XMLCh* text_von_xerces = L&quot;Hallo, Welt&quot;;
std::wstring text_von_std = text_von_xerces;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1058007</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058007</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Mon, 15 May 2006 10:46:07 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandeln Xerces -Variablentyp in std::wstring on Mon, 15 May 2006 10:55:13 GMT]]></title><description><![CDATA[<p>Hallo LordJaxom,</p>
<p>nein , bei mir gibt er einen Fehler .<br />
( Aknn nicht konvertieren... )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058013</guid><dc:creator><![CDATA[Elke100]]></dc:creator><pubDate>Mon, 15 May 2006 10:55:13 GMT</pubDate></item><item><title><![CDATA[Reply to Umwandeln Xerces -Variablentyp in std::wstring on Mon, 15 May 2006 11:18:16 GMT]]></title><description><![CDATA[<p>Hallo LordJaxom ,</p>
<p>ich benutze nicht direkt std::wstring sondern eine Ableitung von wstring.</p>
<p>Jetzt habe ich XMLCh* dem std::wstring zugewiesen und dann auf meinen<br />
Variablentyp gecastet. Scheint zu gehehn. d.h. der Compiler gibt keinen Fehler.</p>
<p>Muss die Anwendung aber noch laufen lassen. Ich melde mich auf jeden Fall nochmals, wenn ich es laufen lasse. Wird aber wahrscheinlich erst morgen sein.<br />
Ich stelle gerade ein Framework auf Unicode um und es müssen noch Anpassungen an ein paar Stellen gemacht werden.</p>
<p>Danke euch allen für die Hilfe !</p>
<p>Liebe Grüße ,<br />
Elke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058032</guid><dc:creator><![CDATA[Elke100]]></dc:creator><pubDate>Mon, 15 May 2006 11:18:16 GMT</pubDate></item></channel></rss>