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. 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 =>