xsl-list
[Top] [All Lists]

RE: [xsl] stylesheet problem - X3D XSLT

2008-05-29 11:06:30
Florent said this already, but you've put an <ImageTexture> element
between the element opening and <xsl:attribute>. Did you mean to put
that attribute on the <ImageTexture> element? You've already set the
"url" attribute on that element through an attribute value template, but
that seems to make the most sense. In any case, <xsl:attribute>
statements have to come before any child elements or text content is
created within the element.

~ Scott


-----Original Message-----
From: j milo taylor [mailto:milo(_at_)suborg(_dot_)net] 
Sent: Thursday, May 29, 2008 9:05 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] stylesheet problem - X3D XSLT 

I'm using Netbeans to put together a project. Mysql - XML - XSLT to X3D

I'm having problems with my stylesheet  and Netbeans can't compile it. I

can't figure out what I'm doing wrong.

Netbeans gives me : line 34: Attribute 'url' outside of element.
null


Here's the stylesheet:

<?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='.8 4 1'>

                           <xsl:attribute 
name="translation"><xsl:value-of select="(position() - 1) * 6"/>
                           </xsl:attribute>

<xsl:template match="Artist_Image">
       <Shape containerField='children'>
         <xsl:for-each select="Artist_Image">

                        <Appearance containerField='appearance'>
                                <ImageTexture containerField='texture' 
url='"http://localhost/images/artists/Ayers/jpg";'/><!-- what should the 
default value be here?-->
                                                     <xsl:attribute 
name="url"><xsl:value-of select="Artist_Image"/> <!--here is the 
problem?-->
                       </xsl:attribute>

                      <Material containerField='material' 
ambientIntensity='0.200' shininess='0.200' diffuseColor='1 .50196 0'/>
                     </Appearance>
                     <Box containerField='geometry' size='5 5 0.2'/>
        </xsl:for-each>

</Shape></xsl:template>
</Transform>                 
</xsl:for-each>
</Group>
</xsl:template>
</xsl:stylesheet>

And here the XML that is transformed:
<?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl"

href="XSLT/X3D-XSLT/X3D-XSLT_for_Test_Artist_Group001.xsl"?>
<artists>
   <artist>
       
<Artist_Image>http://localhost/images/artists/vonHausswolff.jpg</Artist_
Image> 

       <Artist_First_Name>Carl Micheal</Artist_First_Name>
       <Artist_Second_Name>von Hausswolff</Artist_Second_Name>
       <Artist_Year>1956</Artist_Year>
       <Artist_Country>Sweden</Artist_Country>
   </artist>
    <artist>
       
<Artist_Image>http://localhost/images/artists/Hartman.jpg</Artist_Image>
       <Artist_First_Name>Hanna</Artist_First_Name>
       <Artist_Second_Name>Hartman</Artist_Second_Name>
       <Artist_Year>1961</Artist_Year>
       <Artist_Country>Sweden</Artist_Country>
   </artist>
    <artist>
       
<Artist_Image>http://localhost/images/artists/Norda.jpg</Artist_Image>
       <Artist_First_Name>Jesper</Artist_First_Name>
       <Artist_Second_Name>Norda</Artist_Second_Name>
       <Artist_Year>1972</Artist_Year>
       <Artist_Country>Sweden</Artist_Country>
   </artist>
</artists>


Any help/ideas would be really great.

Thanks

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>