Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .release-notes/5.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions corral.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
}
}
8 changes: 5 additions & 3 deletions pony-libxml2/xml2node.pony
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down Expand Up @@ -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 =>
Expand Down