This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Attachment: cygcheck.out
Description: Binary data

<preface id='my-preface-id'>
   <title id='id-for-title'>This is the Preface</title>
</preface>
<?xml version="1.0"?>

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [
  <!ENTITY preface SYSTEM "my-entity.xml">
]>

<book>
  <title id="preface">Broken Repro</title>
  &preface;
</book>
<?xml version="1.0"?>

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [

  <!ENTITY preface "<preface id='my-preface-id'>
                       <title id='id-for-title'>This is the Preface</title>
                    </preface>">
]>

<book>
  <title id="preface">Works Fine</title>
  &preface;
</book>
--
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]