I am trying to parse an XML Document from a file stored in Unicode, with the
Non-Validating DOM Parser.

I write the following Document Declaration line:

L"\xFEFF<?xml version=\"1.0\" encoding=\"UTF-16\" ?>\n"

,and the rest of the XML fields are stored also as Unicode, but with no Byte
Order Mark. It seems that the parser finds no Well-Formedness error, since
no Exceptions are launched during the process.

However, it creates an empty DOM, and the DomLists

parser.getdocument().getChildNodes()

and

parser.getDocument().getElementsByTagName()

are both empty. Moreover,

parser.getDocument().getDocumentElement()

returns a NULL element. Am I doing anything wrong?.
I've tried to use \xFFFE instead of \xFEFF, and even using none of them, and
there is no difference. I've also tried to use the URLInputSource and foce
the UTF-16 encoding by calling setEncoding(L"UTF-16").

Do I need any pre-processor definitions?

Please give some advice or tell me where can I find an example.

Thank you in advance,

Constantino Morera
mailto:[EMAIL PROTECTED]
Trymedia Systems


Reply via email to