Issue 69876 - unoxml: com.sun.star.xml.dom.DocumentBuilder is not working properly for xml documentsa that has no encoding specified
Summary: unoxml: com.sun.star.xml.dom.DocumentBuilder is not working properly for xml ...
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL: http://api.openoffice.org/docs/common...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-26 13:08 UTC by faltrion
Modified: 2017-05-20 11:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
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".