xsltproc emits spurious "ID already define" errors when using SYSTEM ENTITY

David Costanzo david_costanzo@yahoo.com
Sat Oct 10 21:57:00 GMT 2015


cygwin@cygwin.com

I recently upgraded my cygwin packages and xsltproc now emits a lot of spurious errors about invalid doc book that look like this:

"""
broken.xml:1: element preface: validity error : ID my-preface-id already defined
broken.xml:2: element title: validity error : ID id-for-title already defined
"""

The same XML was processed without error before I updated cygwin and is processes without error on my Fedora Core machine. I believe this is a cygwin-specific regression.

There are three problems with these error messages:
1) The ID is *not* already defined.
2) The filename is incorrect. The ID element is not in broken.xml:1, but in an included SYSTEM ENTITY file "my-entity.xml".  The line numbers correspond to their location in that file.
3) No context is printed (for other errors, the line that caused the problem is displayed)

Interestingly, using an inline ENTITY that has the exact same content as the SYSTEM entity does not cause any errors to be emitted (see the "works.xml" attachment).

The good news is that the XSLT transformation still happens, so I can ignore the validation errors and still build the manual.  To work-around this problem, I've added the "--novalid" parameter to the command line and now use xmllint to validate the xml.

I have attached two examples so that someone else can reproduce the problem.  Copy them all into the same directory and reproduce the issue like this:

xsltproc --nonet /usr/share/sgml/docbook/xsl-stylesheets/html/profile-chunk.xsl broken.xml
xsltproc --nonet /usr/share/sgml/docbook/xsl-stylesheets/html/profile-chunk.xsl works.xml

I expect the "broken.xml" to be valid, but it emits errors quoted above.  The "works.xml" example, which inlines the preface entity, instead of using a SYSTEM entity, emits no errors.  This demonstrates that the problem is specific to SYSTEM entities.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 87237 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151010/b733cdfd/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my-entity.xml
Type: text/xml
Size: 99 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151010/b733cdfd/attachment.xml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: broken.xml
Type: text/xml
Size: 271 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151010/b733cdfd/attachment-0001.xml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: works.xml
Type: text/xml
Size: 388 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151010/b733cdfd/attachment-0002.xml>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list