<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум компьютерной помощи &mdash; Парсинг одного элемента из XML файла]]></title>
	<link rel="self" href="https://itpmr.ru/extern.php?action=feed&amp;tid=912&amp;type=atom" />
	<updated>2015-05-15T08:57:24Z</updated>
	<generator>PunBB</generator>
	<id>https://itpmr.ru/viewtopic.php?id=912</id>
		<entry>
			<title type="html"><![CDATA[Парсинг одного элемента из XML файла]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124312#p124312" />
			<content type="html"><![CDATA[<p>Используем объект MS XML Parser.<br />Данный код&nbsp; из файла &quot;123.xml&quot;&nbsp; &nbsp;вытягивает содержимое&nbsp; элемента &quot;konteyner&quot; и сохраняет его в файл &quot;333.xml&quot;.</p><div class="codebox"><pre><code>Sub Click(Source As Button)
    Dim session As New NotesSession
    Dim oXml    
    Set oXml = CreateObject(&quot;Msxml2.DOMDocument&quot;)
    oXml.async = False
    oXml.validateOnParse = True
    localFile$ = &quot;c:\XML\123.xml&quot;
    localFile2$ = &quot;c:\XML\333.xml&quot;
    oXml.Load(localFile$)
    
    If oXml.parseError.ErrorCode = 0 Then 
        Print( &quot;SUCCESS loading XML File&quot;)  
    Else  
        Print(&quot;Ошибка: &quot; &amp; oXml.parseError.reason &amp; &quot; в строке: &quot; &amp; oXml.parseError.line &amp; &quot; позиция: &quot; &amp; oXml.parseError.linepos)
    End If
    
    Set objXMLDOMNodeList = oXml.getElementsByTagName (&quot;konteyner&quot;)
    Set     Item =    objXMLDOMNodeList.item(0)
    cont$ =  Item.xml
    
    Dim Strm As NotesStream
    Set Strm = session.CreateStream
    Call Strm.Open(localFile2$)
    Strm.WriteText (cont$)
    Call Strm.Close
End Sub</code></pre></div><p>Документация: script-coding.com/XMLDOMscripts.html</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2015-05-15T08:57:24Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124312#p124312</id>
		</entry>
</feed>
