Click to See Complete Forum and Search --> : Replace <p> at a specified position in XSLT


anil_gs
06-14-2006, 10:55 AM
We are getting XML that has both text and impages as below. What is the best way to read the images and insert them at a <p> tag in the text, position mentioned by the image attribute? Appreciate any help.

Ex:

<txtbody>
<p>paragraph1</p><p>paragraph2</p><p>paragraph3</p>
</txtbody>

<image>
<image_url>http://test.com/story_images1.jpg</image_url>
<image_orig_url>http://test.com/story_images1.jpg</image_orig_url>
<image_caption>2006 Lexus GS1</image_caption>
<width>100</width>
<position>0</position>
</image>
<image>
<image_url>http://test.com/story_images2.jpg</image_url>
<image_orig_url>http://test.com/story_images2.jpg</image_orig_url>
<image_caption>2006 Lexus GS2</image_caption>
<width>100</width>
<position>1</position>
</image>
<image>
<image_url>http://test.com/story_images3.jpg</image_url>
<image_orig_url>http://test.com/story_images3.jpg</image_orig_url>
<image_caption>2006 Lexus GS3</image_caption>
<width>100</width>
<position>2</position>
</image>