1.0.2 • Published 8 years ago

super-simple-xml v1.0.2

Weekly downloads
7
License
ISC
Repository
-
Last release
8 years ago

Super Simple XML

Description

Super Simple XML provides a stripped down version of XML, allowing only the very basic functionality. The point is to make the interface as intuitive and quick to learn as possible.

Methods

Node(type)

Creates and returns a new node with the tag specified by type.

#setContent(content)

Sets the text content of the Node. Throws an Error if the Node has children.

#addChild(child , position)

Adds the Node "child" to the Node's children list. If position is specified the child will be inserted at that point. Otherwise the child will be appended to the end of the list. Throws an Error if the Node contains content.

#atrr(name , value)

Gets or sets attributes of the Node.

  • If only one parameter is specified the value of that attribute is returned.
  • If two parameters are provided the attribute of the given name is set to the given value.

#addNamespace(name, source)

Adds a namespace to the Node. If name is "default", the default namespace will take the value source.

#toString()

Returns the Node as an XML subtree.

Properties

###type String Sets the tag of the Node.

###namespace String Sets the namespace of the Node.

###attributes Object Holds the name-value pairs for attributes of the Node.

###namespaces Object Holds the name-value pairs for namespace definitions.

###content String The text content of the Node.

###children Array Array of child Nodes.

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago