<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: XMLDOM]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5262&amp;type=atom" />
	<updated>2010-12-09T15:21:06Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5262</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: XMLDOM]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42741#p42741" />
			<content type="html"><![CDATA[<p>Microsoft прямо рекомендует использовать даже «версионный» ProgID, не «version-independent»: начиная с <a href="http://msdn.microsoft.com/en-us/library/ms757837(VS.85).aspx">GUID and ProgID Information</a> — и внутрь по дереву. Своего мнения на этот счёт у меня нет — не работал.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2010-12-09T15:21:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42741#p42741</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: XMLDOM]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42740#p42740" />
			<content type="html"><![CDATA[<p>Спасибо огромное! А можно просветить насчет MSXML2.DOMDocument и Microsoft.XMLDOM, что лучше использовать?</p>]]></content>
			<author>
				<name><![CDATA[SlaDER]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25019</uri>
			</author>
			<updated>2010-12-09T14:43:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42740#p42740</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: XMLDOM]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42712#p42712" />
			<content type="html"><![CDATA[<p>Использовать не «root.appendChild()», а выбранный узел:<br /></p><div class="codebox"><pre><code>Option Explicit

Dim strQuery

With WScript.CreateObject(&quot;MSXML2.DOMDocument&quot;) &#039; &quot;Microsoft.XMLDOM&quot;)
    .async = False
    
    If .load(&quot;E:\Песочница\0020\0001.rdp&quot;) Then
        strQuery = &quot;RDCMan/file/group&quot;
        
        .setProperty &quot;SelectionLanguage&quot;, &quot;XPath&quot;
        .selectNodes(strQuery).item(0).appendChild .createElement(&quot;server&quot;)
        
        WScript.Echo .xml
    End If
End With

WScript.Quit 0</code></pre></div><p>У Вас ошибка: указан тэг «&lt;<strong>s</strong>erver&gt;», а узел создаётся «<strong>S</strong>erver».</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2010-12-08T16:18:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42712#p42712</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: XMLDOM]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42708#p42708" />
			<content type="html"><![CDATA[<p>Привет всем есть XML от Remote Desktop Connection Manager.</p><div class="codebox"><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;RDCMan schemaVersion=&quot;1&quot;&gt;
    &lt;version&gt;2.2&lt;/version&gt;
    &lt;file&gt;
        &lt;properties&gt;
            &lt;name&gt;Название&lt;/name&gt;
            &lt;expanded&gt;True&lt;/expanded&gt;
            &lt;comment/&gt;
            &lt;logonCredentials inherit=&quot;FromParent&quot;/&gt;
            &lt;connectionSettings inherit=&quot;FromParent&quot;/&gt;
            &lt;gatewaySettings inherit=&quot;FromParent&quot;/&gt;
            &lt;remoteDesktop inherit=&quot;FromParent&quot;/&gt;
            &lt;localResources inherit=&quot;FromParent&quot;/&gt;
            &lt;securitySettings inherit=&quot;FromParent&quot;/&gt;
            &lt;displaySettings inherit=&quot;FromParent&quot;/&gt;
        &lt;/properties&gt;
        &lt;group&gt;

        &lt;/group&gt;
    &lt;/file&gt;
&lt;/RDCMan&gt;</code></pre></div><p>Задача добавлять в group</p><div class="codebox"><pre><code>         &lt;server&gt;
                    &lt;name&gt;Имя_сервера&lt;/name&gt;
                    &lt;displayName&gt;Отображаемое имя сервера&lt;/displayName&gt;
                    &lt;comment /&gt;
                    &lt;logonCredentials inherit=&quot;FromParent&quot; /&gt;
                    &lt;connectionSettings inherit=&quot;FromParent&quot; /&gt;
                    &lt;gatewaySettings inherit=&quot;FromParent&quot; /&gt;
                    &lt;remoteDesktop inherit=&quot;FromParent&quot; /&gt;
                    &lt;localResources inherit=&quot;FromParent&quot; /&gt;
                    &lt;securitySettings inherit=&quot;FromParent&quot; /&gt;
                    &lt;displaySettings inherit=&quot;FromParent&quot; /&gt;
         &lt;/server&gt;</code></pre></div><p>Пытаюсь так:</p><div class="codebox"><pre><code>Set objxmlDoc = CreateObject( &quot;Microsoft.XMLDOM&quot; )
objxmlDoc.Async = &quot;False&quot;
objxmlDoc.Load( &quot;c:\Windows.rdg&quot; )

strQuery = &quot;RDCMan/file/group&quot;

Set colNodes = objxmlDoc.selectNodes(strQuery)

Set newXML = objxmlDoc.createElement(&quot;Server&quot;)

Set root = objxmlDoc.documentElement
root.appendChild(newXML)</code></pre></div><p>В итоге идет добавление в конец, как можно зацепиться за group и добавить child в неё?</p>]]></content>
			<author>
				<name><![CDATA[SlaDER]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25019</uri>
			</author>
			<updated>2010-12-08T11:57:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42708#p42708</id>
		</entry>
</feed>
