Issue 69876

Summary: unoxml: com.sun.star.xml.dom.DocumentBuilder is not working properly for xml documentsa that has no encoding specified
Product: App Dev Reporter: faltrion <ca>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, jopp
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
URL: http://api.openoffice.org/docs/common/ref/com/sun/star/xml/dom/DocumentBuilder.html
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description faltrion 2006-09-26 13:08:32 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
Comment 1 jsc 2006-09-26 13:38:05 UTC
jsc -> lo: seems to be one for you
Comment 2 lo 2007-03-06 17:30:30 UTC
confirm+set to new
Comment 3 lo 2007-03-06 17:33:14 UTC
set to 2.x target
Comment 4 Martin Hollmichel 2007-11-09 17:28:46 UTC
set target from 2.x to 3.x according to
http://wiki.services.openoffice.org/wiki/Target_3x
Comment 5 lo 2007-11-14 14:01:23 UTC
reassigned
Comment 6 lo 2007-11-14 14:10:03 UTC
reassigned
Comment 7 Marcus 2017-05-20 11:27:37 UTC
Reset assigne to the default "issues@openoffice.apache.org".