<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум компьютерной помощи &mdash; NotesSAXParser]]></title>
	<link rel="self" href="https://itpmr.ru/extern.php?action=feed&amp;tid=913&amp;type=atom" />
	<updated>2015-05-18T12:36:34Z</updated>
	<generator>PunBB</generator>
	<id>https://itpmr.ru/viewtopic.php?id=913</id>
		<entry>
			<title type="html"><![CDATA[Re: NotesSAXParser]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124314#p124314" />
			<content type="html"><![CDATA[]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2015-05-18T12:36:34Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124314#p124314</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[NotesSAXParser]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124313#p124313" />
			<content type="html"><![CDATA[<p>Пробуем с помощью методов класса NotesSAXParser распарсить XML-ку.</p><div class="codebox"><pre><code>Sub Click(Source As Button)
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Set db = session.CurrentDatabase
    
    Dim saxParser As NotesSAXParser
    
    Dim xml_in As NotesStream
    Set xml_in=session.CreateStream
    filename$ = &quot;C:\XML\123.xml&quot;  &#039; open input file
    xml_in.Open(filename$)
    
    Dim xml_out As NotesStream
    Set xml_out=session.CreateStream
    filename$ = &quot;C:\XML\333.xml&quot; 
    xml_out.Open(filename$)
    
    Set saxParser=session.CreateSAXParser(xml_in, xml_out)
    
    On Event SAX_Characters From saxParser Call SAXCharacters &#039; содержимое элемента
    On Event SAX_StartElement  From saxParser Call SAXStartElement &#039;старт элемента
    
    saxParser.Process
End Sub</code></pre></div><p>Две подпрограммы:<br /></p><div class="codebox"><pre><code>Sub SAXCharacters (Source As Notessaxparser, Byval Characters As String, _
Count As Long)
    Source.Output (&quot; Characters: &quot; + Characters)
End Sub</code></pre></div><div class="codebox"><pre><code>Sub SAXStartElement (Source As Notessaxparser, Byval elementname As String, Attributes As NotesSaxAttributeList)
    Dim i As Integer
    
    Source.Output(&quot; Элемент = &quot;+elementname+&quot;&lt;br&gt;&quot;)
    
    If Attributes.Length &gt; 0 Then
        Dim attrname As String
        For i = 1 To Attributes.Length
            attrname = Attributes.GetName(i)
            fype$ = Attributes.GetType (attrname)
            Source.Output(&quot; Атрибут: &quot;+attrname+    &quot; = &quot;+Attributes.GetValue(attrname) +&quot;, тип: &quot; +fype$ + &quot;//&quot;)
        Next
    End If
End Sub</code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2015-05-18T12:34:25Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124313#p124313</id>
		</entry>
</feed>
