daisy / pipeline-mod-braille

!! NOTE: This project is now part of the pipeline-modules project !! | Braille Production Modules for the DAISY Pipeline 2
1 stars 4 forks source link

Deep inheritance, ++ #88

Closed josteinaj closed 8 years ago

josteinaj commented 8 years ago

Allow scripts to inherit from scripts that inherit from scripts

If you have scripts A and B in the same module, and script C in either the same module or another module, then A needs to extend the generated version of B so that documentation and attributes are carried through from C.

Added support for px:inherit="prepend|append" on elements with px:role="name|desc".

For instance:

<p:option name="stuff" ...>
    <p:documentation xmlns="...">
        <p px:role="name">Stuff</p>
        <p px:role="desc" px:inherit="prepend">This and that</p>
    </p:documentation>
</p:option>

In the above example, the content of the <p px:role="desc"> for the option stuff in the script that this script extends, will be prepended to the description in this script. So the generated content might be:

<p:option name="stuff" ...>
    <p:documentation xmlns="...">
        <p px:role="name">Stuff</p>
        <p px:role="desc">Short description

More description

This and that</p>
    </p:documentation>
</p:option>

Two newlines are inserted between the documentation in the script and the documentation in the script that is extended.

Allow referencing uris from same catalog in px:extends

The issue is that when loading documents referenced by px:extends using the XSLT document function; URIs from within the same catalog.xml does not seem to work. Using this patch, it works. However, corner cases using rewriteURI etc won't work, so it would be better to fix this in ProcessCatalogMojo.java. I'm just not quite sure how.

Other

bertfrees commented 8 years ago

Aha! I wondered what that last commit was about, but that was before I saw this PR. Now it makes sense. Great stuff.

What is "rewriteURI"?

bertfrees commented 8 years ago

https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html#s.rewrite. OK I see. I'll see if there's a proper fix possible.