mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 18:21:04 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9698 72102866-910b-0410-8b05-ffd578937521
195 lines
4.5 KiB
HTML
195 lines
4.5 KiB
HTML
<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: $Revision$</p>
|
|
<p>Date: $Date$</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> NSObject</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>
|
|
+ (GSXMLDocument*) <b>documentWithVersion:</b> (NSString*)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>
|
|
+ (GSXMLDocument*) <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> (NSString*)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>
|
|
- (NSString*) <b>version</b>;<br>
|
|
|
|
<p>
|
|
|
|
Return the version of document.
|
|
</p>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-6">encoding</a></h3>
|
|
- (NSString*) <b>encoding</b>;<br>
|
|
|
|
<p>
|
|
|
|
Return the encoding of document.
|
|
</p>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-7">save:</a></h3>
|
|
- (void) <b>save:</b> (NSString*)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>
|
|
- (GSXMLNode*) <b>root</b>;<br>
|
|
|
|
<p>
|
|
|
|
Return the root name of document.
|
|
</p>
|
|
|
|
|
|
<hr>
|
|
<h3><a name ="method-10">setRoot:</a></h3>
|
|
- (GSXMLNode*) <b>setRoot:</b> (GSXMLNode*)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>
|
|
- (GSXMLDocument*) <b>makeNodeWithNamespace:</b> (GSXMLNamespace*)ns <b>name:</b> (NSString*)name <b>content:</b> (NSString*)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>
|