Using libxml2 in Island project


(Ram Poe) #1

I want to use libxml2 in my Island project(Win32). I have managed to prepare a libxml2.fx file using HeaderImporter and referenced it in my project.

Now I want to access name of the xmlNode but I’m not sure how to do that. This is my code

import libxml
import Swift
let xmlDoc = xmlReadFile("C:\\test.xml", nil, 0)

let rootNode = xmlDocGetRootElement(xmlDoc)!

// How do I access rootNode->name?


rootNode is an UnsafePointer<xmlNode>. How do I dereference it?

(Carlo Kok) #2

*rootNode should return the dereferenced value
so (*rootNode).fieldname