Objective-C API Library Reference  4.3.0-42-g45f162a
 All Classes Functions Typedefs Properties Pages
Public Functions | Public Static Functions | Properties | List of all members
PWXmlElement Class Reference

The PWXmlElement class provides methods for accessing and manipulating XML elements.

Constructors

(id) - initWithName:
 
(id) - initWithName:stringValue:
 
(id) - initWithText:
 
(id) - initWithAttribute:stringValue:
 
(id) - initWithAttribute:stringValue:namespace:
 

Public Functions

(PWXmlElement *) - addAttribute:
 
(PWXmlElement *) - addChild:
 
(PWXmlElement *) - addContent:
 
(PWXmlElement *) - addElement:
 
(PWXmlElement *) - addNamespace:
 
(void) - addTextContent:
 
(PWXmlElement *) - attributeAtIndex:
 
(NSUInteger) - attributeCount
 
(PWXmlElement *) - attributeForName:
 
(NSArray *) - attributes
 
(PWXmlElement *) - childAtIndex:
 
(NSUInteger) - childCount
 
(BOOL) - childExists:
 
(PWXmlElement *) - childForName:
 
(NSArray *) - children
 
(NSArray *) - content
 
(PWXmlElement *) - contentAtIndex:
 
(PWXmlElement *) - copyElement
 
(NSString *) - descriptionWithVersions
 
(NSString *) - descriptionWithVersionsAndAddresses
 
(void) - detach
 
(PWXmlElement *) - elementForName:
 
(NSArray *) - elementsForName:
 
(NSString *) - getChildText:
 
(NSString *) - getOrderedChildName
 
(NSArray *) - getOrderedChildren:
 
(NSString *) - getText
 
(NSString *) - getText:
 
(id) - getTextAs:
 
(id) - getTextAs:childPath:
 
(BOOL) - getTextAsBool
 
(unsigned char) - getTextAsByte
 
(char) - getTextAsChar
 
(NSDate *) - getTextAsDate
 
(NSDecimalNumber *) - getTextAsDecimal
 
(double) - getTextAsDouble
 
(PWGuid *) - getTextAsGuid
 
(short) - getTextAsInt16
 
(int) - getTextAsInt32
 
(long long) - getTextAsInt64
 
(float) - getTextAsSingle
 
(unsigned short) - getTextAsUInt16
 
(unsigned int) - getTextAsUInt32
 
(unsigned long long) - getTextAsUInt64
 
(id) - getTextAsWithChildPathAndDefault:defaultValue:
 
(id) - getTextAsWithDefault:defaultValue:
 
(NSArray *) - getTextNodes
 
(BOOL) - hasAttributes
 
(BOOL) - hasElements
 
(NSString *) - localName
 
(PWXmlElement *) - namespaceAtIndex:
 
(NSArray *) - namespaces
 
(void) - remove
 
(void) - removeAll
 
(void) - removeAttribute:
 
(void) - removeChild:
 
(void) - removeChildAtIndex:
 
(void) - removeElementWithIndex:
 
(void) - removeElementWithName:
 
(void) - removeNamespace:
 
(void) - removeTextNodes
 
(void) - replaceAttributes:
 
(void) - replaceNodes:
 
(void) - replaceText:
 
(void) - replaceWithTextArray:
 
(void) - replaceWithTextString:
 
(PWXmlParentChild *) - resolveParent:allowCreate:
 
(PWXmlElement *) - resolvePath:
 
(PWXmlElement *) - resolvePath:allowCreate:
 
(PWXmlElement *) - resolvePath:allowCreate:isPathNormalized:
 
(NSString *) - resolvePrefixForNamespaceURI:
 
(void) - setAttribute:
 
(void) - setStringValue:
 
(PWXmlElement *) - setText:content:
 
(void) - setTextToBool:
 
(void) - setTextToByte:
 
(void) - setTextToChar:
 
(void) - setTextToDate:
 
(void) - setTextToDecimal:
 
(void) - setTextToDouble:
 
(void) - setTextToGuid:
 
(void) - setTextToInt16:
 
(void) - setTextToInt32:
 
(void) - setTextToInt64:
 
(void) - setTextToSingle:
 
(void) - setTextToUInt16:
 
(void) - setTextToUInt32:
 
(void) - setTextToUInt64:
 
(void) - setVersionRecursive:
 
(NSString *) - stringValue
 
(long) - updateVersion
 
(NSString *) - XMLString
 

Public Static Functions

(id) + attributeWithName:stringValue:
 
(id) + attributeWithName:stringValue:namespace:
 
(id) + commentWithStringValue:
 
(id) + elementWithName:
 
(PWXmlElement *) + elementWithName:boolValue:
 
(PWXmlElement *) + elementWithName:byteValue:
 
(PWXmlElement *) + elementWithName:charValue:
 
(PWXmlElement *) + elementWithName:dateValue:
 
(PWXmlElement *) + elementWithName:decimalValue:
 
(PWXmlElement *) + elementWithName:doubleValue:
 
(PWXmlElement *) + elementWithName:guidValue:
 
(PWXmlElement *) + elementWithName:int16Value:
 
(PWXmlElement *) + elementWithName:int32Value:
 
(PWXmlElement *) + elementWithName:int64Value:
 
(PWXmlElement *) + elementWithName:singleValue:
 
(id) + elementWithName:stringValue:
 
(PWXmlElement *) + elementWithName:uInt16Value:
 
(PWXmlElement *) + elementWithName:uInt32Value:
 
(PWXmlElement *) + elementWithName:uInt64Value:
 
(id) + elementWithXMLString:error:
 
(PWXmlElement *) + getSessionElement:sessionId:
 
(PWXmlElement *) + getSessionElement:sessionId:allowCreate:
 
(NSString *) + getSessionElementName:
 
(PWGuid *) + getSessionId:
 
(PWXmlElement *) + namespaceWithPrefix:URI:
 
(NSString *) + normalizePath:
 
(PWXmlElement *) + parse:
 
(int) + parseOrdinal:
 
(NSString *) + resolvePrefixForURI:atNode:
 
(void) + retainRecursiveWithVersion:version:
 
(id) + textWithStringValue:
 

Properties

NSString * name
 
PWXmlElementparent
 
NSString * prefix
 
PWXmlElementType type
 
NSString * URI
 
NSString * value
 
long version
 

Methods Descriptions

- (PWXmlElement *) addAttribute: (PWXmlElement *)  attribute

Adds an attribute to this node.

- (PWXmlElement *) addChild: (PWXmlElement *)  element

Adds the specified child element.

- (PWXmlElement *) addContent: (PWXmlElement *)  element

Adds the specified content.

- (PWXmlElement *) addElement: (PWXmlElement *)  element

Adds the specified element.

- (PWXmlElement *) addNamespace: (PWXmlElement *)  namespace

Adds the specified namespace.

- (void) addTextContent: (NSString *)  content

Adds the specified text content.

- (PWXmlElement *) attributeAtIndex: (NSUInteger)  index

Returns the attribute node stored at specified index.

- (NSUInteger) attributeCount

Returns the number of attributes assigned to the element.

- (PWXmlElement *) attributeForName: (NSString *)  name

Returns the attribute node with the specified name.

- (NSArray *) attributes

Returns a list of this node's attributes.

+ (id) attributeWithName: (NSString *)  name
stringValue: (NSString *)  stringValue 

Creates a new attribute node using the specified name and string value.

+ (id) attributeWithName: (NSString *)  name
stringValue: (NSString *)  stringValue
namespace: (NSString *)  namespace 

Creates a new attribute node using the specified name, string value, and namespace.

- (PWXmlElement *) childAtIndex: (NSUInteger)  index

Returns the child node stored at the specified index.

- (NSUInteger) childCount

Returns the number of children under the element.

- (BOOL) childExists: (NSString *)  childName

Check to see if a child exists with specified childName

Parameters
childNamechild's name to search for
Returns
YES if child exists, NO if child does not exist

Provided by category PWXmlElement(PWXmlUtility).

- (PWXmlElement *) childForName: (NSString *)  childName

Returns the child that matches the specified name.

- (NSArray *) children

Returns a list of this node's children.

+ (id) commentWithStringValue: (NSString *)  comment

Creates a new element with the specified text value, and returns this element.

- (NSArray *) content

Returns a list of this node's children.

See Also
- children
- (PWXmlElement *) contentAtIndex: (NSUInteger)  index

Returns the element node stored at specified index.

- (PWXmlElement *) copyElement

Makes a copy of this node.

- (NSString *) descriptionWithVersions

A description helper that includes node versions, expressed as a pretty-printed XML string.

- (NSString *) descriptionWithVersionsAndAddresses

A description helper that includes node versions and pointer addresses, expressed as a pretty-printed XML string.

- (void) detach

Detaches the element from its parent and releases its resources.

- (PWXmlElement *) elementForName: (NSString *)  elementName

Returns the element that matches the specified name.

- (NSArray *) elementsForName: (NSString *)  elementName

Returns an array of all children that match specified name.

+ (id) elementWithName: (NSString *)  name

Creates a new element with the specified name, and returns this element.

+ (PWXmlElement*) elementWithName: (NSString *)  name
boolValue: (BOOL)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
byteValue: (unsigned char)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
charValue: (char)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
dateValue: (NSDate *)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
decimalValue: (NSDecimalNumber *)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
doubleValue: (double)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
guidValue: (PWGuid *)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
int16Value: (short)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
int32Value: (int)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
int64Value: (long long)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
singleValue: (float)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (id) elementWithName: (NSString *)  name
stringValue: (NSString *)  string 

Creates a new element with the specified name and text value, and returns this element.

+ (PWXmlElement*) elementWithName: (NSString *)  name
uInt16Value: (unsigned short)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
uInt32Value: (unsigned int)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement*) elementWithName: (NSString *)  name
uInt64Value: (unsigned long long)  value 

Creates an element with the specified name and sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
nameThe name of the element to create.
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

+ (id) elementWithXMLString: (NSString *)  string
error: (NSError **)  error 

Creates a new element using an XML string, and returns this element.

Parameters
stringThe XML string to use when initializing this element.
errorThe error object for returning error information.
- (NSString *) getChildText: (NSString *)  childName

Returns the text for the specified child name.

- (NSString *) getOrderedChildName

Gets the name of the ordered children of the specified element.

Returns
the ordered child name

Provided by category PWXmlElement(PWXmlUtility).

- (NSArray *) getOrderedChildren: (NSString *)  orderedName

Gets the ordered children of the specified xml element.

Parameters
orderedNamename of the ordered children
Returns
a NASrray of the ordered children

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement *) getSessionElement: (PWXmlElement *)  root
sessionId: (PWGuid *)  sessionId 

Gets the child element of the root corresponding to the specified session. Will create the node if it does not exist.

Parameters
rootThe root
sessionIdThe session id
Returns
PWXmlElement

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement *) getSessionElement: (PWXmlElement *)  root
sessionId: (PWGuid *)  sessionId
allowCreate: (BOOL)  allowCreate 

Gets the child element of the root corresponding to the specified session. Will create the node if it does not exist.

Parameters
rootThe root
sessionIdThe session id
allowCreateif set to YES then allow create
Returns
PWXmlElement

Provided by category PWXmlElement(PWXmlUtility).

+ (NSString *) getSessionElementName: (PWGuid *)  sessionId

Gets the name of a session element with the specified session id.

Parameters
sessionIdThe session id
Returns
a NSString of the element name

Provided by category PWXmlElement(PWXmlUtility).

+ (PWGuid *) getSessionId: (NSString *)  elementName

Gets the id of a session element with the specified element name. Expects an element name of the form SessionId-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Parameters
elementNameThe session element name
Returns
PWGuid

Provided by category PWXmlElement(PWXmlUtility).

- (NSString *) getText

Returns the text from the specified element, which may be an empty string.

- (NSString *) getText: (NSString *)  childPath

Utility method to get the text from the specified element.

Parameters
childPathpath to retrieve the text from
Returns
the text from the specified element, which may be an empty string

Provided by category PWXmlElement(PWXmlUtility).

- (id) getTextAs: (const char *)  objCType

Generic utility method to get the text from the specified element as the specified type.

Parameters
objCTypethe type name
Returns
the XML element converted to an instance of objCType or nil if it could not be converted

Provided by category PWXmlElement(PWXmlUtility).

- (id) getTextAs: (const char *)  objCType
childPath: (NSString *)  childPath 

Generic utility method to get the value of the specified child element as the specified type.

Parameters
objCTypethe type name
childPathpath to the child element, relative to the parent
Returns
the text of the child element or nil if the child does not exist

Provided by category PWXmlElement(PWXmlUtility).

- (BOOL) getTextAsBool

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (unsigned char) getTextAsByte

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (char) getTextAsChar

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (NSDate *) getTextAsDate

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (NSDecimalNumber *) getTextAsDecimal

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (double) getTextAsDouble

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (PWGuid *) getTextAsGuid

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (short) getTextAsInt16

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (int) getTextAsInt32

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (long long) getTextAsInt64

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (float) getTextAsSingle

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (unsigned short) getTextAsUInt16

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (unsigned int) getTextAsUInt32

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (unsigned long long) getTextAsUInt64

Gets the element value, as the specified type using the appropriate type converter.

Returns
The converted value

Provided by category PWXmlElement(PWXmlUtility).

- (id) getTextAsWithChildPathAndDefault: (NSString *)  childPath
defaultValue: (id)  defaultValue 

Generic utility method to get the value of the specified child element.

Parameters
childPathpath to the child element, relative to the parent
defaultValuethe default value to use
Returns
the text of the child element or nil if the child element does not exist

Provided by category PWXmlElement(PWXmlUtility).

- (id) getTextAsWithDefault: (const char *)  objCType
defaultValue: (id)  defaultValue 

Generic utility method to get the value of the specified child element as the specified type.

Parameters
objCTypethe type name
defaultValuethe default value to use
Returns
the text of the child element or nil if the child element does not exist

Provided by category PWXmlElement(PWXmlUtility).

- (NSArray *) getTextNodes

Returns an array of all children that contain a text value.

- (BOOL) hasAttributes

Returns a Boolean value that indicates whether this node has attributes.

- (BOOL) hasElements

Returns a Boolean value that indicates whether this node has children.

- (id) initWithAttribute: (NSString *)  name
stringValue: (NSString *)  stringValue 

Initializes an instance of PWXmlElement with the name and text value of an attribute.

- (id) initWithAttribute: (NSString *)  name
stringValue: (NSString *)  stringValue
namespace: (NSString *)  namespace 

Initializes an instance of PWXmlElement with the text value and namespace of an attribute.

- (id) initWithName: (NSString *)  name

Initializes an instance of PWXmlElement with a name.

- (id) initWithName: (NSString *)  name
stringValue: (NSString *)  stringValue 

Initializes an instance of PWXmlElement with a name and text value.

- (id) initWithText: (NSString *)  stringValue

Initializes an instance of PWXmlElement with a text value.

- (NSString *) localName

Returns this element's local name.

- (PWXmlElement *) namespaceAtIndex: (NSUInteger)  index

Returns the namespace node stored at specified index.

- (NSArray *) namespaces

Returns a list of this node's namespaces.

+ (PWXmlElement *) namespaceWithPrefix: (NSString *)  prefix
URI: (NSString *)  URI 

Creates a node with the specified namespace.

+ (NSString *) normalizePath: (NSString *)  path

Normalizes an XML path.

Parameters
paththe path to normalize
Returns
the normalized path

Provided by category PWXmlElement(PWXmlUtility).

+ (PWXmlElement *) parse: (NSString *)  xmlString

Create a new XElement using an XML string

Parameters
xmlStringXML string to initialize this element with
Returns
XElement

Provided by category PWXmlElement(PWXmlUtility).

+ (int) parseOrdinal: (NSString *)  childName

Gets the ordinal from a child name. Returns -1 for all names except those that match the pattern "#integer", in which case the integer value after the octothorpe is returned.

Parameters
childNamename of the child
Returns
the ordinal or -1 if child name did not match the ordinal pattern

Provided by category PWXmlElement(PWXmlUtility).

- (void) remove

Removes this element.

- (void) removeAll

Removes all children and attribute nodes.

- (void) removeAttribute: (PWXmlElement *)  node

Removes the specified attribute.

- (void) removeChild: (PWXmlElement *)  node

Removes the specified child.

- (void) removeChildAtIndex: (NSUInteger)  index

Removes the child element at the specified index.

- (void) removeElementWithIndex: (NSInteger)  index

Remove child element at specified index

Parameters
indexindex of child to remove

Provided by category PWXmlElement(PWXmlUtility).

- (void) removeElementWithName: (NSString *)  childName

Remove child element that has specified name

Parameters
childNamename of child to remove

Provided by category PWXmlElement(PWXmlUtility).

- (void) removeNamespace: (PWXmlElement *)  node

Removes the specified namespace.

- (void) removeTextNodes

Deletes all children that contain a text value.

- (void) replaceAttributes: (NSArray *)  element

Replaces all attributes with attributes supplied in the specified array.

- (void) replaceNodes: (NSArray *)  nodes

Replaces all children with nodes supplied in the specified array.

- (void) replaceText: (id)  newText

Utility method to replace the text nodes of an element.

Parameters
newTextobject to replace current text. Valid objects are NSString and NSArray

Provided by category PWXmlElement(PWXmlUtility).

- (void) replaceWithTextArray: (NSArray *)  newTextArray

Utility method to replace the text nodes of an element.

Parameters
newTextArraythe new text

Provided by category PWXmlElement(PWXmlUtility).

- (void) replaceWithTextString: (NSString *)  newTextString

Utility method to replace the text nodes of an element.

Parameters
newTextStringthe new text

Provided by category PWXmlElement(PWXmlUtility).

- (PWXmlParentChild *) resolveParent: (NSString *)  path
allowCreate: (BOOL)  allowCreate 

Resolves the parent and child elements of the specified path in the specified element.

Parameters
paththe path
allowCreateif set to YES then allow create
Returns
a ParentChild containing references to the parent and child

Provided by category PWXmlElement(PWXmlUtility).

- (PWXmlElement *) resolvePath: (NSString *)  path

Resolves the path.

Parameters
paththe path
Returns
The child element at the specified path.

Provided by category PWXmlElement(PWXmlUtility).

- (PWXmlElement *) resolvePath: (NSString *)  path
allowCreate: (BOOL)  allowCreate 

Resolves the path.

Parameters
paththe path
allowCreateif set to YES to allow creation along the path, otherwise NO
Returns
The child element at the specified path, or nil if it does not exist

Provided by category PWXmlElement(PWXmlUtility).

- (PWXmlElement *) resolvePath: (NSString *)  path
allowCreate: (BOOL)  allowCreate
isPathNormalized: (BOOL)  isPathNormalized 

Resolves the path.

Parameters
paththe path
allowCreateif set to YES to allow creation along the path, otherwise NO
isPathNormalizedif set to YES if the path is normalized, otherwise NO
Returns
the child element at the specified path, or null if it does not exist

Provided by category PWXmlElement(PWXmlUtility).

- (NSString *) resolvePrefixForNamespaceURI: (NSString *)  namespaceURI

Resolves the prefix of a namespace URI.

+ (NSString *) resolvePrefixForURI: (NSString *)  uri
atNode: (PWXmlElement *)  nodePtr 

Resolves the URL prefix at the specified node.

+ (void) retainRecursiveWithVersion: (PWXmlElement *)  node
version: (long)  version 

Sets the version and retains all nodes recursively starting at node. This updates all of the nodes including attributes.

Parameters
noderoot node at which to begin operation
versionthe version to set on all of the nodes

Provided by category PWXmlElement(PWXmlUtility).

- (void) setAttribute: (PWXmlElement *)  attribute

Sets new attribute value. If this attribute does not exist, it adds it.

- (void) setStringValue: (NSString *)  value

Sets a node with the specified text value.

- (PWXmlElement *) setText: (NSString *)  childPath
content: (NSString *)  content 

Sets an element value, creating the element it if it doesn't already exist.

Parameters
childPathpath to the the child element
contentthe child element value
Returns
The child containing the value

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToBool: (BOOL)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToByte: (unsigned char)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToChar: (char)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToDate: (NSDate *)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToDecimal: (NSDecimalNumber *)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToDouble: (double)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToGuid: (PWGuid *)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToInt16: (short)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToInt32: (int)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToInt64: (long long)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToSingle: (float)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToUInt16: (unsigned short)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToUInt32: (unsigned int)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setTextToUInt64: (unsigned long long)  value

Sets the elements value using the corresponding PWXmlTypeConversion converter.

Parameters
valueThe value to set convert and set the resulting text.

Provided by category PWXmlElement(PWXmlUtility).

- (void) setVersionRecursive: (long)  version

Recursively sets the version for this element and its child attributes and elements.

- (NSString *) stringValue

Returns a node value expressed as a text string.

+ (id) textWithStringValue: (NSString *)  stringValue

Creates a new element using a text value, and returns this element.

- (long) updateVersion

Updates the version of this element. The version is incremented automatically by 1.

- (NSString *) XMLString

Returns an element's value, expressed as an XMLString object.

Properties Descriptions

- (NSString*) name
readwritenonatomicstrong

The name of the element.

- (PWXmlElement*) parent
readwritenonatomicweak

The parent of this element in the tree hierarchy.

- (NSString*) prefix
readwritenonatomicstrong

A URL prefix.

- (PWXmlElementType) type
readwritenonatomicassign

The data type of the element.

- (NSString*) URI
readwritenonatomicstrong

A URI on the element.

- (NSString*) value
readwritenonatomicstrong

The value currently assigned to the element.

- (long) version
readwriteatomicassign

The current version of a PWXmlElement object.