dxml behavior after exception: continue parsing
Jesse Phillips
Jesse.K.Phillips+D at gmail.com
Mon May 7 19:46:00 UTC 2018
So I have an XML like document which fails to adhere completely
to XML. One of these such events is that & is used without
escaping.
My observation is that after the exception it is possible to move
to the next element without issue. Is this something expected and
will be maintained?
try {
range.popFront();
} catch (Exception e) {
range.popFront;
}
As an aside, here is a snippet for skipping over the BOM since
dxml doesn't expect the BOM to be there:
import std.encoding;
import std.algorithm;
auto fileContent = cast(ubyte[])read(file);
if(getBOM(fileContent).schema != BOM.none)
fileContent.skipOver(getBOM(fileContent).sequence);
More information about the Digitalmars-d-learn
mailing list