xsl-list
[Top] [All Lists]

RE: images and captions

2002-09-24 07:55:43

I would recommend building an RTF containing all <img> and <caption>
elements, images having a generated id, something like:

<img id="aa1"/>
<caption value="Picture blah blah"/>
<img id="ab2"/>
<caption value="more blah blah"/>

Then when you come across an <img> you can query the RTF for the
correspoding <img> by id, then if the next node is a <caption> use its
@value as the @alt in your output.

This will only work if the caption for an image is between the image its
meant for and the following image.  I cant really see how you could
include captions that appear before it as well, as you are basically
saying 'the caption could appear anywhere'...

but you never know, someone might have a neat solution.

cheers
andrew   

-----Original Message-----
From: Nathan Shaw [mailto:n8_shaw(_at_)yahoo(_dot_)com]
Sent: 24 September 2002 15:24
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] images and captions


hi all.

I am using a product called YAWC to allow users to
enter news releases into Word and then export them
into XML. Everything is going ok except for images and
their captions.

Because of the way the images and their captions get
exported, there is no link between them. In the
resulting xml doc I get from the export from Word,
they look like this:

<p><img src="C:\Documents and Settings\nshaw.HQIRMS\My
Documents\genericpics\ISS\transhub.jpg"
height="120.75" width="156.75"/></p>
<caption>Picture of the ISS TransHAB.</caption>

What I do is take that xml and transform it into
another xml doc that I can work with a bit easier
before transforming it into html, txt and pdf.
So, my question is, how can I, in XSLT, shove the
caption into my Media tag (<Media type="image"
file="transhub.jpg" alt="Picture of the ISS TransHAB"
/>) without having any direct link between the two
elements?

The <caption> element will most likely follow the
<img> element, but that is not always the case. It may
be above it in some cases. Not every img will have a
caption.

Ideas?

Thanks,

--Nathan

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 19/09/2002
 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 19/09/2002
 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>