Menu

Problem with <xi:include>

2016-06-06
2016-06-07
  • Stefan Quandt

    Stefan Quandt - 2016-06-06

    I maintain a DocBook5 manual where chapters are organized in separate XML files and included in a main XML via <xi:include>
    This used to work with daps2 throughout the last two years but currently I can no longer generate the manual: For some of the included chapters i get hundreds of errors
    error: attribute "moreinfo" not allowed here;

    All error message point to the line of the these <xi:include> so I have no clue what the actual problem could be.

     
  • Frank Sundermeyer

    Hi,

    if it has worked for the last two years, you mast have changed something that is causing the errors.

    • Did you do a DAPS update? If so, what was the last DAPS version that worked?
    • Did you do a DocBook5 update?
    • Did you update your Linux distribution (BTW: What distribution and version are you running?)
    • Did you do any significant changes to your XML files?

    Also, if the error only occurs with some of your documents, there must be a difference between the ones that work and those that don't. Any idea what this difference could be?

    Last, the full error message would be helpful. Please run

    daps -f -d <DC-file> --debug validate
    

    Bye,
    Frank

     
  • Stefan Quandt

    Stefan Quandt - 2016-06-06

    Did you do a DAPS update ?

    Yes, I did a new install of openSUSE 42.1. Currently I have daps-2.1.5 with docbook_5-5

    If so, what was the last DAPS version that worked?

    I'll try to find out.

    Did you do any significant changes to your XML files?

    No.

    there must be a difference between the ones that work and those that don't.
    Any idea what this difference could be?

    There are two 'good' ones which are just short (using <link> and <xref> though).
    I'll do some stripping down of a complex one down until the errors disappear.

    $ daps -d DC-manual-draft --debug validate
    Validating...`
    ##>>>>>>>>>>>>>>>>>>>>>>>>>>8782>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    /usr/share/daps/libexec/daps-jing  /usr/share/xml/docbook/schema/rng/5.0/docbookxi.rng /home/stefan/devel/handbuch/build/.profiled/noprofile_remarks/manual.xml
    ##<<<<<<<<<<<<<<<<<<<<<<<<<<8782<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    Java virtual machine used: /usr/lib64/jvm/jre/bin/java
    classpath used: /usr/share/java/jing.jar:/usr/share/java/xerces-j2.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/saxon6.jar:/usr/share/java/xml-commons-resolver.jar:/usr/share/java/batik-all.jar:/usr/share/java/excalibur/avalon-framework-impl.jar
    main class used: com.thaiopensource.relaxng.util.Driver
    flags used: '-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration'
    options used: '-Xss3072K'
    arguments used: /usr/share/xml/docbook/schema/rng/5.0/docbookxi.rng /home/stefan/devel/handbuch/build/.profiled/noprofile_remarks/manual.xml
    /home/stefan/devel/handbuch/build/.profiled/noprofile_remarks/manual.xml:31:40: error: attribute "moreinfo" not allowed here; expected attribute "annotations", "arch", "audience", "condition", "conformance", "dir", "function", "linkend", "ns:actuate", "ns:arcrole", "ns:href", "ns:role", "ns:show", "ns:title", "ns:type", "os", "otherfunction", "remap", "revision", "revisionflag", "role", "security", "userlevel", "vendor", "version", "wordsize", "xml:base", "xml:id", "xml:lang" or "xreflabel" (with xmlns:ns="http://www.w3.org/1999/xlink")
    
     
  • Frank Sundermeyer

    Hi,

    thanks for providing the information.

    How does line 31 in /home/stefan/devel/handbuch/build/.profiled/noprofile_remarks/manual.xml look like (that should be the line containing the moreinfo attribute)?

    The attribute "moreinfo" does not exist in DocBook5, seems it has been removed with the transition from DocBook4 to Docbook5. That is the reason why it does not validate.

    Does it validate when removing the moreinfo attribute? IMHO that should fix the error.

    Bye,
    Frank

     
    • Stefan Quandt

      Stefan Quandt - 2016-06-06

      Line 31 of this (generated) manual.xml is just an include:

      <xi:include href="basics.xml"/>
      

      And the referenced basics.xml does not (and never did) contain anything like 'moreinfo'.
      Neither my original basics.xmlchapter nor the generated artifact handbuch/build/.profiled/noprofile_remarks/basics..xml.
      Also if i edit my basics.xml chapter and make it an <article> (instead of <chapter>) then daps would compile it into a proper PDF document if not unresolved linkendreferences to other chapters would be treated as errors (by the way: is there a workaround to ignore these errors, this would make life easier in certain debug situations?).

      There has never been a 'moreinfo' attribute in my XML and the errors do not really point to one and i have no idea where these come from.

       
      • Frank Sundermeyer

        Also if i edit my basics.xml chapter and make it an <article> (instead of <chapter>)
        then daps would compile it into a proper PDF document if not unresolved linkend
        references to other chapters would be treated as errors (by the way: is there a
        workaround to ignore these errors, this would make life easier in certain debug
        situations?).

        If a ROOTID is specified (either in the DC-file or on the command line), the "bigfile" command generates a single XML file where xrefs pointing to targets outside the current document are resolved to text. This bigfile can then be used (by using --main <bigfile> to generate the PDF):</bigfile>

        $ daps -d DC-daps-user bigfile
        Find the bigfile at:
        /data/git/daps/doc/build/.tmp/book.daps.user_bigfile.xml
        $ mv build/.tmp/book.daps.user_bigfile.xml xml/
        $ daps --main xml/book.daps.user_bigfile.xml pdf
        PDF book built with REMARKS=0, DRAFT=no and META=0:
        /data/git/daps/doc/build/book.daps.user_bigfile/book.daps.user_bigfile_color_en.pdf
        
         
  • Stefan Quandt

    Stefan Quandt - 2016-06-06

    It turns out all these errors regarding a moreinfo attributes are a consequence of adding a processing instruction from example 6.9 of the daps user guide

    <?xml-stylesheet href="urn:x-daps:xslt:profiling:docbook45-profile.xsl" 
    type="text/xml" title="Profiling step"?>
    

    to my main XML.
    This processing instruction is for DocBook 4 only and thus a mistake.

    Thanks
    Stefan Q.

     
    • Thomas Schraitle

      Hi Stefan,

      glad you find out what the problem was.

      I've looked into the example you've mentioned and actually found a small bug. The DocBook 5.0 example had a problem with the missing DocBook5 namespace.
      It's fixed now in commit https://github.com/openSUSE/daps/commit/8812f8455119800c but not yet published.

      Thanks!

       
  • Frank Sundermeyer

    Hi,

    urn:x-daps:xslt:profiling:docbook50-profile.xsl
    or
    urn:x-daps:xslt:profiling:docbook51-profile.xsl

    are the ones that are needed for DocBook 5.0 or 5.1 (respectively).

    By
    Frank

    BTW: As a result of this discussion, I filed

    to make debugging a bit easier in the future..

     
  • Stefan Quandt

    Stefan Quandt - 2016-06-07

    ... to make debugging a bit easier in the future..
    Thanks, this will be really helpful.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB