Hi Christian,

cloneNode requires a boolean parameter, with the follwing meaning

true : clone node together with any children
false : clone without children

Maybe this is the reason for returning a null object.

HTH
Dieter

Christian Andersson wrote:
Hi there, I'm trying to use the xml dom system to read and parse an xml
file, so far I have sucessfully managed to do all that I need, except
for one thing.

I'm not sure why, but I cannot get cloneNode to work, all I get back is
a null object..

I'm writing all of this in Openoffice.org Basic.
here is a sample of what I'm doing

        oSFA = createUNOService ("com.sun.star.ucb.SimpleFileAccess")
        oInpStream = oSFA.openFileRead(sUrl)
        oDB = createUnoService("com.sun.star.xml.dom.DocumentBuilder")
        oDoc = oDB.parse(oInpStream)
        oInpStream.closeInput

        oDoc.getFirstChild()
        clone = oDoc.cloneNode

clone here will now be null and not a clone of the object as I wanted it
to be. Is there anything obvious that I have missed?

everything else that I have been doing with the dom system has been
working as expected


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to