# Dtd\_property' expected, found \`entities(\_)'

**URL:** <https://swi-prolog.discourse.group/t/dtd-property-expected-found-entities/6766>\
**Category:** General\
**Tags:** bug\
**Created:** [August 11, 2023, 6:02am UTC](https://swi-prolog.discourse.group/t/dtd-property-expected-found-entities/6766 "2023-08-11T06:02:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdiestel](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/wdiestel/32/22_2.png) [@wdiestel](https://swi-prolog.discourse.group/u/wdiestel)\
**Post date:** [August 11, 2023, 6:02am UTC](https://swi-prolog.discourse.group/t/dtd-property-expected-found-entities/6766/1 "2023-08-11T06:02:23Z")

</div>

Hello,

I have a program analyzing some 1000 files using concurrent\_maplist. It worked fine until recently, but now I get from time to time such an error in random places:

`Domain error: `dtd\_property’ expected, found `entities(_37838)'`

I don’t see where this is coming from, because I don’t read or write XML code. HTML I just write using format. So I suppose it may some SWI internal issue introduced with a recent version?

I’m now using:

SWI-Prolog version 9.0.4 for x86\_64-linux

---

<div class="post-metadata">

**Author:** ![wdiestel](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/wdiestel/32/22_2.png) [@wdiestel](https://swi-prolog.discourse.group/u/wdiestel)\
**Post date:** [August 11, 2023, 6:08am UTC](https://swi-prolog.discourse.group/t/dtd-property-expected-found-entities/6766/2 "2023-08-11T06:08:42Z")

</div>

I just found, that I use `xml_quote_cdata` in one place. So it may be related to the issue.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 11, 2023, 7:34am UTC](https://swi-prolog.discourse.group/t/dtd-property-expected-found-entities/6766/3 "2023-08-11T07:34:14Z")

</div>

I can’t say what you are using, but the error comes from dtd\_property/2, which surely is not used by `xml_quote_cdata/3`. `xml_quote_cdata/3` is thread safe, but dtd\_property/2 turned out to have a race condition when used for the first time from multiple threads that explains this error. Pushed a fix.
