<?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[XML Node mit mehreren Childs und NodeValues verschachteln]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich brüte gerade über einem etwas kniffeligem XML (eigentlich ist das XML nicht wirklich komplex) mein Problem ist das es eine Kombination aus mehreren Elementen und Text Values ist.</p>
<p>Das Ergebnis soll so aussehen.</p>
<pre><code>&lt;a&gt;
   &lt;xsl:attribute name=&quot;href&quot;&gt;&lt;xsl:value-of select=&quot;$url_main&quot;/&gt;main.jsp?template=&lt;xsl:value-of select=&quot;normalize-space(link)&quot;/&gt;&amp;amp;lang=&lt;xsl:value-of select=&quot;$lang&quot;/&gt;&amp;amp;poid=&lt;xsl:value-of select=&quot;$portal_id&quot;/&gt;&lt;/xsl:attribute&gt;
   &lt;xsl:value-of select=&quot;name&quot;&gt;&lt;/xsl:value-of&gt;
&lt;/a&gt;
</code></pre>
<p>Mir ist es im Moment nicht so ganz klar wie ich einem Node ein Child danach einen NodeValue dann wieder ein Child und wiederum einen NodeValue beibringen kann.</p>
<p>Mein bisheriger Ansatz ist kurz dieser hier</p>
<pre><code>_di_IXMLNode NodeA = activeNode-&gt;AddChild(&quot;a&quot;, WideString(&quot;&quot;));
 _di_IXMLNode Nodeb = NodeA-&gt;AddChild(&quot;xsl:attribute&quot;);
 Nodeb-&gt;Attributes[WideString(&quot;name&quot;)] = WideString(&quot;href&quot;);
 _di_IXMLNode Nodea = Nodeb-&gt;AddChild(&quot;xsl:value-of&quot;);
 Nodea-&gt;Attributes[WideString(&quot;select&quot;)] = WideString(&quot;$url_main&quot;);
// Nodeb-&gt;SetNodeValue(WideString(&quot;main.jsp?template=&quot;));
</code></pre>
<p>Die letzte Zeile verursacht ein Problem deswegen ist sie im Moment auskommentiert.</p>
<p>Evtl. hat jemand schon mal ähnliches erfolgreicher gelöst als ich.</p>
<p>Gruss</p>
<p>Mirko</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/153085/xml-node-mit-mehreren-childs-und-nodevalues-verschachteln</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 05:42:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/153085.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Jul 2006 17:34:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to XML Node mit mehreren Childs und NodeValues verschachteln on Wed, 12 Jul 2006 17:34:47 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich brüte gerade über einem etwas kniffeligem XML (eigentlich ist das XML nicht wirklich komplex) mein Problem ist das es eine Kombination aus mehreren Elementen und Text Values ist.</p>
<p>Das Ergebnis soll so aussehen.</p>
<pre><code>&lt;a&gt;
   &lt;xsl:attribute name=&quot;href&quot;&gt;&lt;xsl:value-of select=&quot;$url_main&quot;/&gt;main.jsp?template=&lt;xsl:value-of select=&quot;normalize-space(link)&quot;/&gt;&amp;amp;lang=&lt;xsl:value-of select=&quot;$lang&quot;/&gt;&amp;amp;poid=&lt;xsl:value-of select=&quot;$portal_id&quot;/&gt;&lt;/xsl:attribute&gt;
   &lt;xsl:value-of select=&quot;name&quot;&gt;&lt;/xsl:value-of&gt;
&lt;/a&gt;
</code></pre>
<p>Mir ist es im Moment nicht so ganz klar wie ich einem Node ein Child danach einen NodeValue dann wieder ein Child und wiederum einen NodeValue beibringen kann.</p>
<p>Mein bisheriger Ansatz ist kurz dieser hier</p>
<pre><code>_di_IXMLNode NodeA = activeNode-&gt;AddChild(&quot;a&quot;, WideString(&quot;&quot;));
 _di_IXMLNode Nodeb = NodeA-&gt;AddChild(&quot;xsl:attribute&quot;);
 Nodeb-&gt;Attributes[WideString(&quot;name&quot;)] = WideString(&quot;href&quot;);
 _di_IXMLNode Nodea = Nodeb-&gt;AddChild(&quot;xsl:value-of&quot;);
 Nodea-&gt;Attributes[WideString(&quot;select&quot;)] = WideString(&quot;$url_main&quot;);
// Nodeb-&gt;SetNodeValue(WideString(&quot;main.jsp?template=&quot;));
</code></pre>
<p>Die letzte Zeile verursacht ein Problem deswegen ist sie im Moment auskommentiert.</p>
<p>Evtl. hat jemand schon mal ähnliches erfolgreicher gelöst als ich.</p>
<p>Gruss</p>
<p>Mirko</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1096636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1096636</guid><dc:creator><![CDATA[mirko.goergen]]></dc:creator><pubDate>Wed, 12 Jul 2006 17:34:47 GMT</pubDate></item><item><title><![CDATA[Reply to XML Node mit mehreren Childs und NodeValues verschachteln on Thu, 13 Jul 2006 09:29:45 GMT]]></title><description><![CDATA[<p>eigentlich hab ich davon keinen Plan <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    />, aber versuch mal folgendes:</p>
<pre><code class="language-cpp">TXMLDocument *XML = new TXMLDocument(&quot;&quot;);

...

_di_IXMLNode Nodeb = NodeA-&gt;AddChild(&quot;xsl:attribute&quot;, &quot;&quot;);
Nodeb-&gt;Attributes[WideString(&quot;name&quot;)] = WideString(&quot;href&quot;);

_di_IXMLNode Nodea = Nodeb-&gt;AddChild(&quot;xsl:value-of&quot;, &quot;&quot;);
Nodea-&gt;Attributes[WideString(&quot;select&quot;)] = WideString(&quot;$url_main&quot;);

_di_IXMLNode Nodec = XML-&gt;CreateNode(WideString(&quot;main.jsp?template=&quot;), ntText, &quot;&quot;);
Nodeb-&gt;ChildNodes-&gt;Add(Nodec);
Nodea = Nodeb-&gt;AddChild(&quot;xsl:value-of&quot;, &quot;&quot;);
Nodea-&gt;Attributes[WideString(&quot;select&quot;)] = WideString(&quot;normalize-space(link)&quot;);

Nodec = XML-&gt;CreateNode(WideString(&quot;&amp;lang=&quot;), ntText, &quot;&quot;);
Nodeb-&gt;ChildNodes-&gt;Add(Nodec);
Nodea = Nodeb-&gt;AddChild(&quot;xsl:value-of&quot;, &quot;&quot;);
Nodea-&gt;Attributes[WideString(&quot;select&quot;)] = WideString(&quot;$lang&quot;);

Nodec = XML-&gt;CreateNode(WideString(&quot;&amp;poid=&quot;), ntText, &quot;&quot;);
Nodeb-&gt;ChildNodes-&gt;Add(Nodec);
Nodea = Nodeb-&gt;AddChild(&quot;xsl:value-of&quot;, &quot;&quot;);
Nodea-&gt;Attributes[WideString(&quot;select&quot;)] = WideString(&quot;$portal_id&quot;);

...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1096975</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1096975</guid><dc:creator><![CDATA[Linnea]]></dc:creator><pubDate>Thu, 13 Jul 2006 09:29:45 GMT</pubDate></item></channel></rss>