Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] X3D XSLT

From: "Darcy Parker" <darcyparker@--------->
To:
Date: 6/2/2008 7:37:00 PM
Have you tried David Carlisle's advice?  As he pointed out, you can't
have nested xsl:template elements.

As well, did you consider his additional comment on the nested
Artist_Image elements?  David questioned whether you really have
nested Artist_Image elements... If you don't have nested Artist_Image
elements, then the <xsl:for-each> is an error because you already
matched Artist_Image using the template.

You didn't mention any error messages.  As David pointed out, you may
find it helpful to setup a test outside of your java environment and
use Saxon standalone so that you have visibility to the error
messages.

Perhaps the following is what you're looking for? (I am assuming you
don't have nested Artist_Image elements... and I have moved the inner
<xsl:template> out... and added <xsl:apply-templates>

<?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="/">
		<!--Why do you have the &X10; when you have indent="yes"?-->
		<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>
				</Transform>
				<Shape containerField='children'>
					<xsl:apply-templates select="Artist_Image"/>
				</Shape>
			</xsl:for-each>
		</Group>
	</xsl:template>
	
	<xsl:template match="Artist_Image">
		<Appearance containerField='appearance'>
			<ImageTexture containerField='texture'>
				<xsl:attribute name="url">
					<xsl:value-of select="Artist_Image"/>
				</xsl:attribute>
			</ImageTexture>
			<Material containerField='material' ambientIntensity='0.200'
shininess='0.200' diffuseColor='1 .50196 0'/>
		</Appearance>
		<Box containerField='geometry' size='5 5 0.2'/>
	</xsl:template>

</xsl:stylesheet>

On Mon, Jun 2, 2008 at 3:16 PM, j milo taylor <milo@xxxxxxxxxx> wrote:
> Hi,
>
> This is still not compiling. I have followed Dean's advice, but Netbeans now
> throws up (2 ?) errors
>
> null
> Could not compile stylesheet
> Could not compile stylesheet
> XML validation finished.
>
>
> From this code:
>
> <?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>
> </Transform>
> <xsl:template match="Artist_Image"><!-- something still not right from here
> -->
>       <Shape containerField='children'>
>         <xsl:for-each select="Artist_Image">
>
>                        <Appearance containerField='appearance'>
>                                <ImageTexture containerField='texture'>
>                                                     <xsl:attribute
> name="url"><xsl:value-of select="Artist_Image"/>
>                       </xsl:attribute></ImageTexture>
>                      <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><!-- until here?-->
>
> </xsl:for-each>
> </Group>
> </xsl:template>
> </xsl:stylesheet>
>
>
> Anyone got any thoughts about this?
>
> Regards
> Milo


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent