[xml] Add new pretty-printing and sorting options for saving XML

2010-10-06 Thread Adam Spragg
much better at storing and merging them too - particularly if combined with hooks to enforce the canonical style. Please let me know what you think of the idea and patches. Are they suitable for libxml? At all? With work? (If so, what?) Thanks, Adam Spragg

[xml] [PATCH 6/6] When sorting, also do DOCTYPE contents.

2010-10-06 Thread Adam Spragg
Puts a canonical order on XML_ELEMENT_DECL, XML_ATTRIBUTE_DECL and XML_ENTITY_DECL nodes. --- xmlsave.c | 143 + 1 files changed, 115 insertions(+), 28 deletions(-) diff --git a/xmlsave.c b/xmlsave.c index 5e9d1eb..e298559 100644 ---

[xml] [PATCH 5/6] Factor out xmlNodeDumpOutputInternalFormatted()

2010-10-06 Thread Adam Spragg
--- xmlsave.c | 41 ++--- 1 files changed, 26 insertions(+), 15 deletions(-) diff --git a/xmlsave.c b/xmlsave.c index 086b31e..5e9d1eb 100644 --- a/xmlsave.c +++ b/xmlsave.c @@ -801,6 +801,31 @@ xmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {

[xml] [PATCH 1/6] Force _xmlSaveCtxt.format to be 0 or 1

2010-10-06 Thread Adam Spragg
And check accordingly. This will allow other values of format to be used for other purposes. --- xmlsave.c | 32 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/xmlsave.c b/xmlsave.c index aaa5da8..745b98d 100644 --- a/xmlsave.c +++ b/xmlsave.c

[xml] [PATCH 4/6] Add xmlSaveOption XML_SAVE_SORT

2010-10-06 Thread Adam Spragg
Adds option, initial implementation, and xmllint parameter for use. --- include/libxml/xmlsave.h |1 + xmllint.c| 11 + xmlsave.c| 96 ++ 3 files changed, 108 insertions(+), 0 deletions(-) diff --git

[xml] [PATCH 2/6] Allow format to take many values.

2010-10-06 Thread Adam Spragg
--- xmllint.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xmllint.c b/xmllint.c index 88c4a6b..aca0a7d 100644 --- a/xmllint.c +++ b/xmllint.c @@ -2510,14 +2510,14 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {

[xml] [PATCH 3/6] Add xmlSaveOption XML_SAVE_WSNONSIG

2010-10-06 Thread Adam Spragg
Adds option, initial implementation, and xmllint parameter for use. --- include/libxml/xmlsave.h |3 +- xmllint.c| 22 +++ xmlsave.c| 92 + 3 files changed, 107 insertions(+), 10 deletions(-) diff --git

Re: [xml] Add new pretty-printing and sorting options for saving XML

2010-10-23 Thread Adam Spragg
Hiya, On Thursday 07 Oct 2010 07:45:43 Martin (gzlist) wrote: On 05/10/2010, Adam Spragg a...@spra.gg wrote: The idea of these options is to be able to combine them to produce a canonical, nearly line-oriented format for XML files. Are you familiar with the Canonical XML W3C

Re: [xml] Add new pretty-printing and sorting options for saving XML

2010-10-23 Thread Adam Spragg
On 05/10/2010, Adam Spragg a...@spra.gg wrote: The idea of these options is to be able to combine them to produce a canonical, nearly line-oriented format for XML files. Are you familiar with the Canonical XML W3C Recommendation and its implementation in libxml2? [snip] The idea seems

Re: [xml] Add new pretty-printing and sorting options for saving XML

2010-10-23 Thread Adam Spragg
Hi. On Tue, Oct 05, 2010 at 10:22:22PM +0100, Adam Spragg wrote: there is already an implementation in libxml of C14N Oh, I missed that. I figured the features I was looking for would be part of the save API, given how it affects what gets saved. Or maybe the tree API for doing things like

Re: [xml] Add new pretty-printing and sorting options for saving XML

2010-10-26 Thread Adam Spragg
Daniel, On Tuesday 12 Oct 2010 08:40:52 Daniel Veillard wrote: On Tue, Oct 12, 2010 at 09:34:11AM +0200, Daniel Veillard wrote: On Tue, Oct 05, 2010 at 10:22:22PM +0100, Adam Spragg wrote: libxml developers, Please find for your consideration a series of patches to add 2 new