Getting images to show in my document

Having trouble installing Oxygen? Got a bug to report? Post it all here.
ianc
Posts: 2
Joined: Wed Jul 22, 2015 12:27 pm

Getting images to show in my document

Post by ianc »

Hi,

I'm using Author mode and want images to display in the document. They display fine when in the same folder as the XML file but I can't seem to figure out how to display them when they are contained in a neighbouring folder.

Folder structure:
Root
-> OSE (where the XML file is contained and some graphics)
-> Graphics (where most of the other images are)

I don't want to edit the XML attributes for the image tags. And I don't really want to add new tags.

I am using CSS to show the images in the OSE folder

Code: Select all

figure {
content : attr(xsrc , url) ;
}
Is there anything I can do with CSS or another kind of transformation I can do?

Thanks in advance
Ian
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Getting images to show in my document

Post by mihaela »

Hi,

The xsrc attribute value contains only the name of the image file? If this is the case I think that you can use the following css to display the images with the same name, located in the Graphics folder:

Code: Select all


figure {
content : oxy_url("../Graphics/", attr(xsrc));
}
Here is the documentation for oxy_url() function:
http://www.oxygenxml.com/doc/versions/1 ... ction.html

If this is not your use-case please give us a small xml sample.

Best regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
ianc
Posts: 2
Joined: Wed Jul 22, 2015 12:27 pm

Re: Getting images to show in my document

Post by ianc »

Apologies for not posting any of the XML too.

I'm afraid that your solution did not work, however I did find a similar workaround. Yours changed the drive of the file I was working on for some reason.

This is what I found that worked:

Code: Select all

content: oxy_url(attr(xsrc, url), oxy_replace(attr(xsrc, url), "ose", "graphics"));

Code: Select all

<figure id="fig5" xsrc="filename.tif">
...some other stuff
</figure>
thanks for the help
Ian
Post Reply