]> git.ipfire.org Git - thirdparty/asterisk.git/commit
xmldoc.c: Fix dump of xml document
authorGeorge Joseph <gjoseph@digium.com>
Fri, 20 Jul 2018 11:20:25 +0000 (05:20 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 23 Jul 2018 11:47:31 +0000 (06:47 -0500)
commit460ef41f7aea09d1b1af332bba95ed5fa6f8d98b
treec1f3fe4f8872ce8b432c6f31bcd2a3d636ec3e48
parent4f1953da7eb96d46462b1c58c1d363084030dba6
xmldoc.c:  Fix dump of xml document

The "xmldoc dump" cli command was simply concatenating xml documents
into the output file.  The resulting file had multiple "xml"
processing instructions and multiple root elements which is illegal.
Normally this isn't an issue because Asterisk has only 1 main xml
documentation file but codec_opus has its own file so if it's
downloaded and you do "xmldoc dump", the result is invalid.

* Added 2 new functions to xml.c:
    ast_xml_copy_node_list creates a copy of a list of children.
    ast_xml_add_child_list adds a list to an existing list.

* Modified handle_dump_docs to create a new output document and
  add to it the children from each input file.  It then dumps the
  new document to the output file.

Change-Id: I3f182d38c75776aee76413dadd2d489d54a85c07
include/asterisk/xml.h
main/xml.c
main/xmldoc.c