[Up] [Next]

GSXMLNamespace

Authors

Michael Pakhantsov
Richard Frith-Macdonald

Version: $Revision$

Date: $Date$

GSXMLNamespace

GSXMLNamespace

Declared in: GSXML.h

Inherits from: NSObject


XML namespace.

Instance Variables

Methods


Class Methods

namespaceWithNode:prefix:href:

+ (GSXMLNamespace*) namespaceWithNode: (GSXMLNode*)node prefix: (NSString*)prefix href: (NSString*)href;

Creation of a new Namespace. This function will refuse to create a namespace with a similar prefix than an existing one present on this node.

example


             ....
             GSXMLNamespace *ns1, *ns2;
             GSXMLNode *node1, *node2;
             NSString *prefix = @"mac-os-property";
             NSString *href   = @"http://www.gnustep.org/some/location";

             ns = [GSXMLNamespace namespaceWithNode: nil
                                               href: href
                                             prefix: prefix];
             node1 = [GSXMLNode nodeWithNamespace: ns name: @"node1"];

             node2 = [GSXMLNode nodeWithNamespace: nil name: @"node2"];
             ns2 = [GSXMLNamespace namespaceWithNode: node2
                                                href: href
                                              prefix: prefix];

             Result:

             node1   <mac-os-property:node1/>
             node2   <node2 xmlns="mac-os-property"/>
             
 

descriptionFromType:

+ (NSString*) descriptionFromType: (int)type;

Return the string constant value for the namespace type given.


typeFromDescription:

+ (int) typeFromDescription: (NSString*)desc;

Return the numeric constant value for the namespace type named. This method is inefficient, so the returned value should be saved for re-use later. The possible values are -


namespaceFrom:

+ (GSXMLNamespace*) namespaceFrom: (void*)data;

Creation of a new Namespace from libxml data.



Instances Methods

initWithNode:prefix:href:

- (id) initWithNode: (GSXMLNode*)node prefix: (NSString*)prefix href: (NSString*)href;

Creation of a new Namespace. This function will refuse to create a namespace with a similar prefix than an existing one present on this node.


initFrom:

This is the designated initialiser
- (id) initFrom: (void*)data;

Creation of a new Namespace from libxml data.


lib

- (void*) lib;

Return pointer to xmlNs structure.


prefix

- (NSString*) prefix;

Return namespace prefix.


href

- (NSString*) href;

Return namespace http reference.


next

- (GSXMLNamespace*) next;

Return next namespace.


type

- (int) type;

Return numeric type code of namespace.


typeDescription

- (NSString*) typeDescription;

Return string type code of namespace.