Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 12th, 2006, 01:14 PM
Registered User
 
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default identifying image position in incoming in xml..

Hi,

I have this sample xml shown below. Basically this is online exam. Each question I get will have instructions, actual question and answer. This xml i am transforming to xhtml and showing in front end. everything working fine,except one thing image positioning.Now all images i am getting aligning left in output.

Based on where image present we have to do apply some css alignment rules. This below example has images in all the 3 sections (instructions, question and answer sections).

My problem is how to identify where the image is present(position & get that position) in xsl(Is this on instruction level or question level or answer level).Once i can identify position i can apply css rules based on position. how to get this image position,where its present?

The xml i get some will have images,some with out images, some only images in instruction..etc possible combinations.

<?xml version="1.0" encoding="UTF-8"?>
<question>
<contentUnit contentID="4" type="instruction"><![CDATA[Answer the questions.]]></contentUnit>
    <contentUnit contentID="3" type="exhibit">
        <image SOURCE="testart_instructions.gif">
            <gif actualheight="288" actualwidth="288"/>
        </image>
    </contentUnit>
<![CDATA[(exhibit EVERYWHERE) Approximately how many miles would you have to travel from Wilmington, North Carolina, to reach Williamsburg, Virginia?This is actual question]]>
    <contentUnit contentID="3" type="exhibit">
        <image SOURCE="testart_questionsample.gif">
            <gif actualheight="288" actualwidth="288"/>
        </image>
    </contentUnit>
<answer correctness="100"><![CDATA[200 fill in the blank answer goes here. ]]>
    <contentUnit contentID="3" type="exhibit">
            <image SOURCE="testart_answersample.gif">
                <gif actualheight="288" actualwidth="288"/>
            </image>
    </contentUnit>
</answer>
</question>

waiting for the reply.

Thanks,
Vijay







Similar Threads
Thread Thread Starter Forum Replies Last Post
xml tag position change rajesh_css XSLT 1 November 3rd, 2008 04:25 AM
Getting the position of a node in the original XML zvikico XSLT 8 July 17th, 2008 09:31 AM
XML, XSL:FO- saving position() mikevn123 XSLT 0 August 8th, 2006 02:51 PM
Customised list - Image position problem terra CSS Cascading Style Sheets 6 September 1st, 2005 01:28 PM
IDENTIFYING THE PORTS abdul_owiusa C# 3 August 7th, 2004 04:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.