From 71b27a3c942df34f83dc2b4f6c108fedb9c68cad Mon Sep 17 00:00:00 2001 From: Red Davies Date: Fri, 9 Jan 2026 18:07:06 -0500 Subject: [PATCH 1/2] Added Xml2node.nodeDump(): String val --- Makefile | 2 +- corral.json | 4 ++-- pony-libxml2/xml2node.pony | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a1c572c..7b99ab5 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ unit-tests: $(tests_binary) $(tests_binary): $(GEN_FILES) $(SOURCE_FILES) | $(BUILD_DIR) $(GET_DEPENDENCIES_WITH) - $(PONYC) -o $(BUILD_DIR) $(SRC_DIR)/_tests -b pony-libxml2 + $(PONYC) -o $(BUILD_DIR) $(SRC_DIR) build-examples: $(EXAMPLES_BINARIES) diff --git a/corral.json b/corral.json index 339b0ba..203f1fa 100644 --- a/corral.json +++ b/corral.json @@ -7,8 +7,8 @@ "description": "Pony binding to libxml2", "homepage": "https://github.com/redvers/pony-libxml2", "license": "", - "documentation_url": "", - "version": "", + "documentation_url": "https://redvers.github.io/pony-libxml2/", + "version": "1.0.3", "name": "" } } diff --git a/pony-libxml2/xml2node.pony b/pony-libxml2/xml2node.pony index e1b0011..22855f3 100644 --- a/pony-libxml2/xml2node.pony +++ b/pony-libxml2/xml2node.pony @@ -69,8 +69,11 @@ class Xml2node end rv - - +// fun xmlNodeDump(pbuf: NullablePointer[XmlBuffer], pdoc: NullablePointer[XmlDoc], pcur: NullablePointer[XmlNode], plevel: I32, pformat: I32): I32 => + fun ref nodeDump(plevel: I32, pformat: I32): String val => + var buf: NullablePointer[XmlBuffer] = LibXML2.xmlBufferCreate() + LibXML2.xmlNodeDump(buf, ptr.pdoc, ptr', plevel, pformat) + LibXML2.xmlBufferContent(buf) // fun htmlAutoCloseTag(pdoc: NullablePointer[XmlDoc], pname: String, pelem: NullablePointer[XmlNode]): I32 => // fun htmlIsAutoClosed(pdoc: NullablePointer[XmlDoc], pelem: NullablePointer[XmlNode]): I32 => @@ -150,7 +153,6 @@ class Xml2node // fun xmlNodeAddContent(pcur: NullablePointer[XmlNode], pcontent: String): None => // fun xmlNodeBufGetContent(pbuffer: NullablePointer[XmlBuffer], pcur: NullablePointer[XmlNode]): I32 => // fun xmlNodeDumpOutput(pbuf: NullablePointer[XmlOutputBuffer], pdoc: NullablePointer[XmlDoc], pcur: NullablePointer[XmlNode], plevel: I32, pformat: I32, pencoding: String): None => -// fun xmlNodeDump(pbuf: NullablePointer[XmlBuffer], pdoc: NullablePointer[XmlDoc], pcur: NullablePointer[XmlNode], plevel: I32, pformat: I32): I32 => // fun xmlNodeGetBase(pdoc: NullablePointer[XmlDoc], pcur: NullablePointer[XmlNode]): String => // fun xmlNodeGetContent(pcur: NullablePointer[XmlNode]): String => // fun xmlNodeGetLang(pcur: NullablePointer[XmlNode]): String => From 82fd246a627e94472bace378ef49a1641982ab5a Mon Sep 17 00:00:00 2001 From: Red Davies Date: Fri, 9 Jan 2026 18:29:38 -0500 Subject: [PATCH 2/2] Added release notes. --- .release-notes/5.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .release-notes/5.md diff --git a/.release-notes/5.md b/.release-notes/5.md new file mode 100644 index 0000000..acfe2e7 --- /dev/null +++ b/.release-notes/5.md @@ -0,0 +1,4 @@ +## Added Xml2node.nodeDump(): String val + +This function allows you to dump a textual representation of the current +node and all their children into pony String.