Commit Graph

14 Commits

Author SHA1 Message Date
Shaun Duncan 72c0afcf93 Reworked the tests just a bit 2013-10-25 17:31:10 -04:00
Shaun Duncan ecf8264ac7 Fixed inadvertent recursion in SelectNodes. Updated/add tests for this behavior 2013-10-25 16:44:32 -04:00
Felix Geisendörfer b3124cf4a7 Implement text nodes / content escaping
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.
2013-09-11 12:17:56 +02:00
Felix Geisendörfer 08c0943149 fix: String() handled ns prefixes incorrectly
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.
2013-09-04 00:35:22 +02:00
jimt c085b35fb9 Adds optional indented output for the Node.String() and Node.Bytes()
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.
2012-11-25 23:46:56 +01:00
Rodrigo Damazio 0459b7b32e Making the recursive SelectNodes a separate function and adding tests 2012-07-29 16:28:03 -03:00
jim teeuwen 032fe9d27c Run gofmt and fix the Unmarshal test. 2012-02-29 11:42:39 +01:00
jim teeuwen 817a15ca8b Remove CharsetFunc as field for Document type and instead supply it as a parameter for all Document.LoadXXX methods. There should be no need to store the function pointer in the Document struct. 2012-02-29 11:21:35 +01:00
jim teeuwen 4b31ea924d gofix error 2011-11-02 16:50:45 +01:00
jim teeuwen 4f7417ecbc Minor improvements in Node.Bytes() implementation. Some test case tweaking. 2011-09-30 12:06:20 +02:00
jim teeuwen 2a2a591c08 Add wildcard support for node names. Allows selecting of all child nodes with a specific namespace (See issue #4). 2011-07-13 05:17:00 +02:00
jim teeuwen 882ba8d0bb Switch to more liberay CC0 public domain license 2011-03-19 14:50:46 +01:00
jim teeuwen c271c20e08 Fix bug in document.correctEncoding() which failed to properly parse xml doctypes. 2011-01-27 22:10:38 +01:00
jim teeuwen 9b53d04d9d Making package easily usable with goinstall. Including the reference to go-iconv. 2011-01-20 22:48:03 +01:00
Renamed from xmlx/xmlx_test.go (Browse further)