SWI-Prolog / packages-sgml

The SWI-Prolog SGML/XML/HTML parser
4 stars 10 forks source link

How to write comments with the xml_write/3 that comes with SWI-Prolog 7.6.4? #27

Open edom opened 5 years ago

edom commented 5 years ago

The document does not say anything about XML comments.

I saw the source code, and I found no syntax tree node for XML comments either.

JanWielemaker commented 5 years ago

AFAIK, comments are not supported as part of the Prolog XML DOM. Only the call-back interface can be used to get information about comments. I have no concrete plans to do something about it. If you plan to add support for comments I'd surely consider to apply the patches.

edom commented 5 years ago

At first I thought it would be a matter of adding some DCG rules, but then I saw some C files, and realized how mistaken I was. I thought it was a pure Prolog library. I'm afraid I can't send any patches.

Nevertheless, not having comments is not fatal for my use case. It's a minor cosmetic issue. (I'm generating a Java/Maven pom.xml file with Prolog.)

Thank you for writing the library. It did help me do what I needed to do, and I can live with it.