libs-base/Documentation/gsdoc/GSXMLDocument.html

196 lines
5 KiB
HTML
Raw Normal View History

<html><head>
<title>GSXMLDocument</title>
</head>
<body>
<a href="GSXMLAtrribute.html">[Previous]</a>
<a href="GSXML.html">[Up]</a>
<a href="GSXMLParser.html">[Next]</a>
<h1>GSXMLDocument</h1>
<h3>Authors</h3>
<dl>
<dt>Michael Pakhantsov
<dd>
</dl>
<p>Version: 0.2</p>
<p>Date: 15 September, 2000</p>
<h2><a name="cont-0">GSXMLDocument</a></h2>
<h2><a name="GSXMLDocument">GSXMLDocument</a></h2>
<p><b>Declared in:</b> GSXML.h</p>
<p><b>Inherits from:</b> <A HREF="NSObject.html#NSObject">NSObject</A></p>
<hr>
<p>
XML Document.
</p>
<h2>Instance Variables</h2>
<ul>
</ul>
<h2>Methods</h2>
<ul>
<li><a href="GSXMLDocument.html#method-3">+documentFrom:</a>
<li><a href="GSXMLDocument.html#method-0">+documentWithVersion:</a>
<li><a href="GSXMLDocument.html#method-6">-encoding</a>
<li><a href="GSXMLDocument.html#method-4">-initFrom:</a>
<li><a href="GSXMLDocument.html#method-2">-initWithVersion:</a>
<li><a href="GSXMLDocument.html#method-8">-lib</a>
<li><a href="GSXMLDocument.html#method-11">-makeNodeWithNamespace:name:content:</a>
<li><a href="GSXMLDocument.html#method-9">-root</a>
<li><a href="GSXMLDocument.html#method-7">-save:</a>
<li><a href="GSXMLDocument.html#method-10">-setRoot:</a>
<li><a href="GSXMLDocument.html#method-5">-version</a>
</ul>
<hr><h2>Class Methods</h2>
<h3><a name="method-0">documentWithVersion:</a></h3>
+ (<A HREF="GSXMLDocument.html#GSXMLDocument">GSXMLDocument</A>*) <b>documentWithVersion:</b> (<A HREF="NSString.html#NSString">NSString</A>*)version;<br>
<p>
Creation of a new XML document.
</p>
<a name="label-1">example</a>
<pre>
id d = [GSXMLDocument documentWithVersion: @"1.0"];
[d setRoot: [d makeNodeWithNamespace: nil name: @"plist" content: nil]];
[[d root] setProp: @"version" value: @"0.9"];
n1 = [[d root] makeChildWithNamespace: nil name: @"dict" content: nil];
[n1 makeComment: @" this is a comment "];
[n1 makePI: @"pi1" content: @"this is a process instruction"];
[n1 makeChildWithNamespace: nil name: @"key" content: @"Year Of Birth"];
[n1 makeChildWithNamespace: nil name: @"integer" content: @"65"];
[n1 makeChildWithnamespace: nil name: @"key" content: @"Pets Names"];
</pre>
<hr>
<h3><a name="method-3">documentFrom:</a></h3>
+ (<A HREF="GSXMLDocument.html#GSXMLDocument">GSXMLDocument</A>*) <b>documentFrom:</b> (void*)data;<br>
<p>
Creation of a new Document from libxml data.
</p>
<hr>
<hr><h2>Instances Methods</h2>
<h3><a name="method-2">initWithVersion:</a></h3>
- (id) <b>initWithVersion:</b> (<A HREF="NSString.html#NSString">NSString</A>*)version;<br>
<p>
Creation of a new XML document.
</p>
<hr>
<h3><a name="method-4">initFrom:</a></h3>
<b>This is the designated initialiser</b><br>
- (id) <b>initFrom:</b> (void*)data;<br>
<p>
Creation of a new Document from libxml data.
</p>
<hr>
<h3><a name="method-5">version</a></h3>
- (<A HREF="NSString.html#NSString">NSString</A>*) <b>version</b>;<br>
<p>
Return the version of document.
</p>
<hr>
<h3><a name="method-6">encoding</a></h3>
- (<A HREF="NSString.html#NSString">NSString</A>*) <b>encoding</b>;<br>
<p>
Return the encoding of document.
</p>
<hr>
<h3><a name="method-7">save:</a></h3>
- (void) <b>save:</b> (<A HREF="NSString.html#NSString">NSString</A>*)filename;<br>
<p>
Save XML document.
</p>
<hr>
<h3><a name="method-8">lib</a></h3>
- (void*) <b>lib</b>;<br>
<p>
Return pointer to xmlDoc structure.
</p>
<hr>
<h3><a name="method-9">root</a></h3>
- (<A HREF="GSXMLNode.html#GSXMLNode">GSXMLNode</A>*) <b>root</b>;<br>
<p>
Return the root name of document.
</p>
<hr>
<h3><a name="method-10">setRoot:</a></h3>
- (<A HREF="GSXMLNode.html#GSXMLNode">GSXMLNode</A>*) <b>setRoot:</b> (<A HREF="GSXMLNode.html#GSXMLNode">GSXMLNode</A>*)node;<br>
<p>
Set the root element of the document.
Return the old root element.
</p>
<hr>
<h3><a name="method-11">makeNodeWithNamespace:name:content:</a></h3>
- (<A HREF="GSXMLDocument.html#GSXMLDocument">GSXMLDocument</A>*) <b>makeNodeWithNamespace:</b> (<A HREF="GSXMLNamespace.html#GSXMLNamespace">GSXMLNamespace</A>*)ns <b>name:</b> (<A HREF="NSString.html#NSString">NSString</A>*)name <b>content:</b> (<A HREF="NSString.html#NSString">NSString</A>*)content;<br>
<p>
Creation of a new node element within a document.
</p>
<a name="label-12">example</a>
<pre>
GSXMLNode *n1, *n2;
GSXMLDocument *d;
d = [GSXMLDocument documentWithVersion: @"1.0"];
[d setRoot: [d makeNodeWithNamespace: nil name: @"plist" content: nil]];
[[d root] setProp: @"version" value: @"0.9"];
n1 = [[d root] makeChildWithNamespace: nil name: @"dict" content: nil];
</pre>
<hr>
</body>
</html>