[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

X3D stylesheet - value of, and offset

Subject: X3D stylesheet - value of, and offset
From: milo@xxxxxxxxxx
Date: Wed, 11 Jun 2008 08:58:23 -0400
 X3D stylesheet - value of
Hi,

I need to modify this stylesheet:

Here is some highly 'pseudo' code for what I'm trying to get

for each select artist <Group> attribute y translation = value of
<Artist_Year> - 1900

if <Artist_Year> = <Artist_Year>, x translation + 6

Here's the code: (there are comments below highlighting the lines that
need modification)

---------------

<?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;

            <head>&#10;<title/></head>
                <Scene>

<xsl:apply-templates/>

                </Scene>
        </X3D>

</xsl:template>

<xsl:template match="artists">

<Group>

<xsl:for-each select="artist">

<Transform translation='0 0 0'>


here is where i need the change-->


<xsl:attribute name="translation">
<xsl:text> 0 </xsl:text>
<xsl:value-of select="(position() -1) * 6 + 2"/>
<xsl:text> 0 </xsl:text>
</xsl:attribute> <--! to here? --!>

                <Shape>
                      <Appearance>
                       <xsl:element name="ImageTexture">
                       <xsl:attribute name="url">
                       <xsl:value-of select="Artist_Image"/>
                        </xsl:attribute>
                        </xsl:element>

<Material containerField='material' ambientIntensity='0.2'
shininess='0.2' diffuseColor='1 .5 0'/>
                      </Appearance>

<Box containerField='geometry' size='3 3 0.1'/>

</Shape>

</Transform>

<Transform translation='0 1.1 0'>

<xsl:attribute name="translation">
<xsl:text> 2 </xsl:text>
<xsl:value-of select="(position() -1) *6 + 1.1"/>
<xsl:text> 0 </xsl:text>
</xsl:attribute>
               <Shape>
                    <Appearance>

<Material containerField='material' ambientIntensity='0.2'
shininess='0.2' diffuseColor='255 255 255'/>

</Appearance>

<xsl:element name="Text">
<xsl:attribute name="string">
<xsl:value-of select="Artist_Year"/> <!-- and this is the value i want
in the <Group> transform annotated above --!>
</xsl:attribute>
</xsl:element>
                </Shape>

</Transform>

    </xsl:for-each>
    </Group>
</xsl:template>

</xsl:stylesheet>

-------------

Any thoughts?

Best Regards
J Milo Taylor

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.