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
|