Ticket Hash: 2ca7a4547a9820c824289fd20871f94a213d7a23
Title: test dom-2.29 may fail
Status: Closed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Resolution: Not_A_Bug
Last Modified: 2018-10-16 22:10:24
Version Found In: 0.9.1
User Comments:
anonymous added on 2018-10-14 14:48:04:

Hello! I maintain the FreeBSD port of tDOM and am now trying to upgrade it to 0.9.1. One of the self-tests is failing:

==== dom-2.29 parse not well-formed document with undeclared xml prefix FAILED
==== Contents of test case:

    catch {dom parse {<foo:e/>}} errMsg
    string range $errMsg 0 30

---- Result was:
---- Result should have been (exact matching):
Namespace prefix is not defined
I suspect, this is due to a different version of expat we are using -- FreeBSD's own "bsdxml" -- but I'm curious, if you've seen this before. I'm marking this test as a "knownBug" on FreeBSD for the time being... Thank you!

rolf added on 2018-10-15 11:32:24:
No, I haven't ever seen this by myself - no matter, if using the
included expat or the system one - nor got this reported by anyone.

What you report looks strange and dubious in several ways and is worth
to be investigated deeper by you (I can't, since I don't see it).

In fact, the test result you got is wrong and the expected result
(error) is right, because that small test document isn't a well-formed
namespaced XML document.

The error isn't detected by expat (which is used in not namespace
aware mode by tdom) but by the dom building code above the expat API
calls. See [https://tdom.org/index.html/artifact?ln=1281-1284&name=de80b190339714cd]

But beside the test dom-2.29 there are other tests (dom-2.28, dom-2.30
and dom-2.31) that tests that code on top of expat and I suppose, this
tests don't fail (otherwise you would have reported them also, I

Is it somehow possible, that you run the 0.9.1 tests with an oder tdom
version? (Although several other tests should also fail then.)

On trunk tdom is already updated to expat 2.2.6 and this test still
runs correct, for me.

What expat version is this "bsbxml", you link against?

Marking the test as "knownBug" sound a bit to blame the bearer of a
message instead of the real reason.

rolf added on 2018-10-16 22:10:24:
Turns out, that I have known this. See [1].

In fact, it was my bug report on upstream (expat), that triggered a
fix (see [2]).

So this is indeed due to a different version of expat you are using --
FreeBSD's own "bsdxml" is apparently 2.1.0 (8 releases behind), while
the tdom source distribution comes bundled with 2.2.5 (one release
behind, with trunk already on current upstream), marking the minimum
expected expat version, if dynamic linking with the sysmte library is

As long as FreeBSD's system expat (libbsdxml) is behind the minimum
required expat version for tdom you should provide your user an option
to get tdom statically linked with the bundled one.

(Wasn't it you to make that [3] fuss about "stop bundling expat"?)

1) [https://github.com/libexpat/libexpat/issues/137]

2) [http://tdom.org/index.html/artifact?ln=523-531&name=e0febcbda4b7d4f1]

3) [https://github.com/tDOM/tdom/issues/27]