SetValue replaces all children of the current node with a single NT_TEXT node and sets its Value to the given parameter.
This lets us replace node values before writing out the document.
Due to the introduction of the NT_TEXT nodes, all of the simple value fetchers
broke. To fix, make a GetValue function fetch all NT_TEXT nodes for
NT_ELEMENT nodes, and put them together, using string.TrimSpace to remove
extra, maintaining compatibility. Then change the .S function to use GetValue
to fetch a node's content. Also, make all the other value fetchers use .S to
get a string representation to convert, centralizing the implementation. Use
.S to centralize the handling of a not found node.
Also, implement a series of tests to verify all the fetcher's functionality.
The test is based on the test produced by Tim Jurcka.
This removes the support for re-indenting XML, but allows to faithfully
parse / stringify a document. Beautification could be added again later
on if desired.
Previously parsing a document like this:
<root xmlns:foo='http:/example.org/foo' foo:bar='1'/>
Would produce an incorrect document when turning it back into a string:
<root xmlns:foo='http:/example.org/foo' http:/example.org/foo:bar='1'/>
This patch fixes this by implementing a proper lookup for namespace
prefixes.
These now cover all the bit sizes for signed and unsigned numbers.
Methods have been implemented for Node values and attributes.
This addresses issue #8
methods. Set the global `IndentPrefix` var to a tab or spaces to
enable indented output. The existing API has not been changed.
This addresses issue #7.