[xsl] X3D XSLT - progress! next question!

Subject: [xsl] X3D XSLT - progress! next question!
From: j milo taylor <milo@xxxxxxxxxx>
Date: Wed, 04 Jun 2008 13:03:27 +0100
Thanks to everyone, especially David, Darcy, Dean and Micheal who has helped me on this. After a few weeks of frustration, I finally got my head around XSLT a little bit.

This now compiles and works, in a very basic way.

The next question I need to resolve regards the "translation" attribute on line 22. I would like this spatial offset to be applied to the <Box Shape> node that follows, AND also to a number of subsequent nodes. In the code fragment below, there is a Text node for example which displays the Artist's Name (there will also be subsequent nodes e.g. <Artist_Year>, <Artist_Details>. Each of these needs to be offset by the same amount as the <Box Shape> node each time another <artist> is found in the XML.

Related to this is another question. How could this transform be applied on the horizontal, rather than the vertical axis?

Here's what I have:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output media-type="model/x3d=xml" doctype-system="http://www.web3d.org/specifications/x3d-3.2.dtd"; method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<X3D profile="Immersive">&#10;


<xsl:template match="artists">
<xsl:for-each select="artist">
<Transform translation='.8 4 1'>
<xsl:attribute name="translation"><xsl:value-of select="(position() -1 ) * 6"/>
<Shape> <Appearance> <xsl:element name="ImageTexture">
<xsl:attribute name="url">
<xsl:value-of select="Artist_Image"/>
<Material containerField='material' ambientIntensity='0.200' shininess='0.200' diffuseColor='1 .50196 0'/>
</Appearance> <Box containerField='geometry' size='5 5 0.2'/>
<Transform translation='2.9 2.6 0'>

<Material containerField='material' ambientIntensity='0.200' shininess='0.200' diffuseColor='1 .50196 0'/>
</Appearance> <xsl:element name="Text">
<xsl:attribute name="string">
<xsl:value-of select="Artist_Second_Name"/>

</Group> </xsl:template>


And some example XML:

<?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl" href="XSLT/X3D-XSLT/X3D-XSLT_for_Test_Artist_Group002.xsl"?>

People's comments about the dev environment I'm using have also been taken on board. Is there a general consensus over the suitablility of me using Saxon-B for this project?

Thanks for any help.
Best Regards

Current Thread