Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 25th, 2006, 04:25 PM
mtp
Guest
 
Posts: n/a
Default Changing fileref path in docbook files

Hello,

in several docbook XML files, i have:

<mediaobject>
<imageobject>
<imagedata fileref="../images/pic1.png"/>
</imageobject>
</mediaobject>

because my XSL toolchain is complicated, fop doesn't manage to find the
png files (bad location). So i would like to preprocess the files by
changing the URLs from "../images/" to "docbook/data/images/". The rest
of the file must not change. Is it possible/easy to do in XSL? If yes, how?

Thanks
  #2  
Old July 25th, 2006, 05:35 PM
Joe Kesselman
Guest
 
Posts: n/a
Default Re: Changing fileref path in docbook files

mtp wrote:
Quote:
Is it possible/easy to do in XSL? If yes, how?
Start with the standard "identity transformation" stylesheet. That will
copy the document unchanged.

Then add a template which recognizes the once case you want to handle
differently, and which implements that difference. For example
(untested, and may be slight overkill):

<xsl:template match="imagedata/@fileref[substring(.,0,3)='../']">
<xsl:attribute name="fileref"
select="concat('docbook/data',substring(.,3))"/>
</xsl:template>


 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles