[fpc-pascal] fpdoc error with XML parsing

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Tue Jul 3 01:07:35 CEST 2018


On 07/02/18 21:28, wkitty42 at windstream.net wrote:
> can fpdoc process comments spanning multiple lines?

Yes it can. That same XML file contains multi-line comments too, and
those don't give issues.

eg:
============================================
...snip...
    <option name="emit-notes" value="false"/>
    <option name="hide-protected" value="true"/>
<!--
    <option name="footer-date" value="yyyy-mm-dd"/>
    <option name="format" value="html"/>
-->
    <option name="format" value="ipf"/>
  </options>
...snip...
============================================


> what happens if you comment each line individually?

I tried this, it made no difference. fpdoc still choked.. Again, ignore
the line wrapping caused by my email client. The comments are all in one
line each.

==============================================
<?xml version="1.0" encoding="utf-8"?>
<!--  Run using:-->
<!--    fpdoc --macro=FPCDIR=/data/devel/fpc-3.1.1/src
--sproject=rtl-project.xml-->
<docproject>
  <options>
    <option name="ostarget" value="FreeBSD"/>
    <option name="cputarget" value="x86_64"/>
    <option name="hide-protected" value="true"/>
...snip...

============================================


$> /data/devel/fpc-3.1.1/x86_64-freebsd/bin/fpdoc
--macro=FPCDIR=/data/devel/fpc-3.0.4/src --project=rtl-project.xml
FPDoc - Free Pascal Documentation Tool
Version 3.1.1 [2017/11/20]
(c) 2000 - 2003 Areca Systems GmbH / Sebastian Guenther, sg at freepascal.org
(c) 2005 - 2012 various FPC contributors

Exception at 000000000052F81A: EXMLReadError:
In 'stream:' (line 3 pos 17): Expected ">".

$>


>From that error message it doesn't seem to like the "--macro" part
inside the xml comment. It seems fpdoc wants to process that "--" as the
end of the comment.

As a test I replaced the two "--" parts in the comment on line 3 with a
single "-" each - just to test. Magically fpdoc now processes the XML
file without issues.

Using Mozilla Firefox (the web browser) and opening the original XML
file, it too fails with a validation error. So I guess "--" is not
allowed inside a xml comment block.  Another reason to dislike XML. ;-)



Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp



More information about the fpc-pascal mailing list