GithubHelp home page GithubHelp logo

dita4publishers / org.dita4publishers.common.xslt Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 2.0 51 KB

Provides XSLT modules and function libraries appropriate for any Open Toolkit transform. Primarily supports the D4P map-driven processing framework.

License: Apache License 2.0

XSLT 100.00%

org.dita4publishers.common.xslt's Introduction

org.dita4publishers.common.xslt's People

Contributors

blefort avatar blefort-uo avatar contrext avatar drmacro avatar jelovirt avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

org.dita4publishers.common.xslt's Issues

Node creation in href-fixup changes base-uri, which later causes df:resolveTopicElementRef() to fail

This is related to issue #10 from the dita4publishers issue tracker (dita4publishers/dita4publishers#10). DITA element nodes get re-created in href-fixup mode, which changes their URI. This means that in the default/normal processing mode for HTML transforms (those that use href-fixup) resolution of xrefs cannot succeed with df:resolveTopicElementRef() (a workaround could have been to pass in the topicref as the relevant context element to the function). This will be solved by using the xml:base attribute to preserve the original node URI. This affects the following plugins:
kindle, html5, html2, epub

Generated graphic copy ANT script fails for graphics with spaces in filenames

So you've got this in your DITA:

<image href="../images/testing%20FP%20JPG-1.jpg"/>

This results in the following in the copy-graphics.xml file:

  <copy toFile="/path/to/images/testing FP JPG-1.jpg"
        overwrite="yes">
     <fileset dir="/path/to/output/images">
        <include name="testing%20FP%20JPG-1.jpg"/>
     </fileset>
  </copy>

Which, in turn, gives you (or, at least, me, on OSX)

BUILD FAILED
/path/to/build_transtype-html2.xml:149: The following error occurred while executing this line:
/path/to/build_transtype-html2.xml:155: The following error occurred while executing this line:
/path/to/copy-graphics.xml:132: Cannot perform operation from directory to file.

I think the fix is to change graphicMap2AntCopyScript.xsl to wrap the file name used in the <include> in relpath:toFile(), like so:

<include name="{relpath:toFile(relpath:getName(@input-url), $platform)}"/>

At least, that seems to work for me. I'll submit a pull request shortly.

outer image and graphic map

The graphic map does seems not support ‘outer’ images. I mean that if an image is in a sibling directory than the ditamap parent directory, the resolved path is wrong.

I found in the generated list that up levels is a property available that seems to provide the ‘real’ parent directory information. The path in the image.list seems show path related to this parent directory.

An example

Map

fr-ca/system/map.ditamap

Images located in

en-ca/system/assets/images/image.jpg

the final path is resolved to

fr-ca/system/fr-ca/system/assets/images/image.jpg

The image.list provides this information, when resolving an image

en-ca/system/assets/images/image.jpg

I found this ant property uplevels, also available in dita.list which seems to provide the missing information, which is in this case:
uplevels = ../../

I am not sure if I can use it.

What do you think about this ?

Enable override of graphic map generation processing

The template <xsl:template match="*[df:class(., 'map/map')]" mode="generate-graphic-map"> in map2graphicMap.xsl uses a for-each loop to process the graphic references collected earlier in the template.

It should apply templates to the graphic references in order to enable customization of the generation of graphic map entries in the final graphic map.

Need to do the same thing for the image list file handling.

Support OT 3.x renamed graphic files

Use the $job variable to dereference rewritten graphic filenames to their source file location:

<xsl:value-of select="key('jobFile', @href, $job)/@src"/>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.