Share

XQilla

Tracker: Feature Requests

7 Add support for BOM output - ID: 2038714
Last Update: Comment added ( unicolet )

I am processing a set of xml documents which have a BOM (EFBBBF) and xqilla
does not seem to output the BOM again after processing them.

I have then tried to hack the xqilla source (which I am building under
windows with vc6 btw) so that it would always add a BOM, but without luck.

The following snippet ilustrates the change that I made to
EventSerializer.cpp:

static const XMLByte BOM_utf8[] = {(XMLByte)0xEF, (XMLByte)0xBB,
(XMLByte)0xBF, (XMLByte) 0};

void EventSerializer::startDocumentEvent(const XMLCh *documentURI, const
XMLCh *encoding)
{
// TBD XML decl? - jpcs
formatter_.writeBOM(BOM_utf8,3);
++level_;
}

I would be very grateful if someone could at least shed some light on how I
could do it and then I would do it on my own, eventually releasing the
source if that is needed.


Umberto Nicoletti ( unicolet ) - 2008-08-05 10:18

7

Deleted

None

John Snelson

None

None

Public


Comments ( 3 )




Date: 2008-08-19 12:40
Sender: unicolet


I have spent some more time into this and eventually decided that I am
going to implement the writebom feature as an external program. This way I
can compile xqilla straight from source without having to mantain a patch
for each version which will ultimately cost me less effort.

Thanks for the support and this great software!
Umberto


Date: 2008-08-18 10:50
Sender: unicolet


I will look into 1 and let you know.
I know about 2, but that's a requirement. Go figure why...

Thanks,
Umberto


Date: 2008-08-18 10:36
Sender: jpcsProject Admin


Your change looks ok. Maybe it's not being output because you aren't
serializing any document nodes? Some things to note:

1) Your code above only works for UTF-8 output - where as the
EventSerializer class handles lots of different encodings.
2) Using a BOM with UTF-8 output is basically pointless, since UTF-8
doesn't suffer from differing byte orders.

John


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2008-08-19 12:40 unicolet
close_date - 2008-08-19 12:40 unicolet
assigned_to nobody 2008-08-18 10:36 jpcs
priority 5 2008-08-05 10:18 unicolet