[oXygen-user] Default folder for images

Oxygen XML Editor Support support at oxygenxml.com
Fri Dec 20 02:51:48 CST 2013


Vincent's solution is indeed the best and easiest to implement for 
seeing the image resolved in the Author mode without any additional 
changes to the XML content.

Translating Vincent's solution to DITA, Nathan's references are like:

> 'href="xx/yy.png"'

So in the main DITA CSS used to render the XML in the Author visual 
editing mode:

> OXYGEN_INSTALL_DIR\frameworks\dita\css_classed\dita.css

you can add a CSS selector to the end of the CSS like:

> *[class~="topic/image"],
> *[class~="topic/image"][placement="inline"] {
>     content: oxy_url('file:/C:/path/to/folder/', attr(href));
> }

Or like in Vincent's example compose the path in a more elaborate manner 
using the Oxygen CSS extension functions:

http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/dg-oxygen-css-functions.html

But again, this is only for editing and rendering inside Oxygen, 
publishing the XML to some output format would still be a problem, as 
long as I know the DITA Open Toolkit engine used by Oxygen to publish 
DITA content does not pass image references through the XML catalogs, so 
you would still need valid relative references for this aspect to work 
properly.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 12/19/2013 9:15 PM, Lizzi, Vincent wrote:
> If you're trying to achieve image display in Author mode you can use oXygen's CSS extensions modify the location of the image file. This is working for me.
>
> All images are stored in a folder named "graphic" that is relative to the location of the XML file. References to image files use a graphic element that contains the file name in an xlink:href attribute, for example:
>
>
> <graphic xlink:href="image.tif"/>
>
>
> Then in Author mode CSS I've defined how the graphic element should be displayed and where to locate the file, for example:
>
>
> graphic {
>    content: oxy_url(oxy_parent-url(attr(xlink|href, url)),"graphic/",attr(xlink|href));
>    vertical-align: middle }
>
>
> This example is not DITA. You might need to change the element and attribute names to something like this:
>
>
> image {
>    content: oxy_url(oxy_parent-url(attr(href, url)),"graphic/",attr(href));
>    vertical-align: middle }
>
>
> and change the folder path for your system. I hope this helps.
>
> Vincent
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>


More information about the oXygen-user mailing list