Apache OpenOffice (AOO) Bugzilla – Issue 69876
unoxml: com.sun.star.xml.dom.DocumentBuilder is not working properly for xml documentsa that has no encoding specified
Last modified: 2017-05-20 11:27:37 UTC
I'm trying to use the com.sun.star.xml.dom.DocumentBuilder service but for me it is not working. The problem is that the xml document do not have an <?xml ...?> processing instruction in it and it have characters that is encoded in ISO-8859-1 (norwegian characters åæø) this makes the parse function in the DocumentBuilder service return null no errors/exceptions or anything just plain null. this is how I wrote my function oSFA = createUNOService ("com.sun.star.ucb.SimpleFileAccess") oInpStream = oSFA.openFileRead(sUrl) oDB = createUnoService("com.sun.star.xml.dom.DocumentBuilder") domDoc = oDB.parse(oInpStream) oInpStream.closeInput It was suggested that I could perheps try to use the TextInputStream to set the encoding to ISO-8859-1 and use that instead, but the person that suggested that now say that it will not work since DocumentBuilder apparently ignores that information. oSFA = createUNOService ("com.sun.star.ucb.SimpleFileAccess") oInpStream = oSFA.openFileRead(sUrl) oTextInpStream = createUnoService("com.sun.star.io.TextInputStream") oTextInpStream.setInputStream(oInpStream) oTextInpStream.setEncoding("iso-8859-1") oDB = createUnoService("com.sun.star.xml.dom.DocumentBuilder") domDoc = oDB.parse(oTextInpStream) oInpStream.closeInput
jsc -> lo: seems to be one for you
confirm+set to new
set to 2.x target
set target from 2.x to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
reassigned
Reset assigne to the default "issues@openoffice.apache.org".