RE: [xsl] Phd Project - XSL for XML to X3D

Subject: RE: [xsl] Phd Project - XSL for XML to X3D
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 2 Feb 2008 18:42:47 -0000
Firstly, Firefox (or any other browser) is not a good development
environment. It's fine for running stylesheets once they are working, but
lousy for debugging. 

Secondly, element names cannot start with a digit:

<2ndname>Marclay</2ndname>

Finally, it's a basic rule of XML that if you use a namespace prefix you
should declare it first. If you want to use

xsd:noNamespaceSchemaLocation="......"

then there must be a namespace declaration

xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance";

It's conventional to use the prefix xsi for this particular namespace. Using
"xsd" is legal but will confuse people.

As this is a PhD project (and indeed, if it were any other project), I'd
suggest you do some more extensive reading about XML and XSLT before you try
to do too much coding.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: j milo taylor [mailto:milo@xxxxxxxxxx] 
> Sent: 02 February 2008 18:19
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Phd Project - XSL for XML to X3D
> 
> Hi everyone,
> 
> I am working on an interesting database-based realtime 3D 
> application . 
> It is a database of sound artists. A MySql query outputs an 
> XML file, which i  have got working fine. My aim is then to 
> to transform this into a dynamically generated x3d virtual 
> environment. I have got some guidance from the Stylus Studio 
> list, they then pointed me here.
> 
> I am attempting then, MySQL -> XML -> X3D. And it is the 
> transformation from XML to X3D that I am having difficulties with:
> 
> So i have an xml file containing my database content:
> 
> for example: *artists.xml*
> ------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet 
> type="text/xsl" href="artists.xsl"?> <artists> <artist> 
> <2ndname>Marclay</2ndname> </artist> <artist> 
> <2ndname>Kubish</2ndname> </artist> <artist> 
> <2ndname>Gal</2ndname> </artist> </artists>
> --------------------------------
> 
> and my artists xsl file:  *artists.xsl*
> 
> ------------------------------
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> <http://www.w3.org/1999/XSL/Transform>
> <xsl:output doctype-public="ISO//Web3D//DTD X3D 3.0//EN" 
> doctype-system="http://www.web3d.org/specifications/x3d-3.0.dtd"; 
> <http://www.web3d.org/specifications/x3d-3.0.dtd> method="xml" 
> encoding="US-ASCII" indent="yes" omit-xml-declaration="yes"/>
> 
> <xsl:template match="/">
> 
> <X3D profile="Immersive" 
> xsd:noNamespaceSchemaLocation="http://www.web3d.org/specificat
> ions/x3d-3.0.xsd" 
> <http://www.web3d.org/specifications/x3d-3.0.xsd> version="3.0">
> 
> <Scene>
> <xsl:comment> create a transform for each cd </xsl:comment> 
> <xsl:apply-templates select="artists/artist"/> </Scene> 
> </X3D> </xsl:template>
> 
> <xsl:template match="artist">
> 
> <Transform>
> 
> <xsl:attribute name="translation">
> <xsl:value-of select="(position() - 1) * 10"/> <xsl:text> 0 
> 0</xsl:text> </xsl:attribute>
> 
> <Shape>
> <Text string="{2ndname}"/>
> </Shape>
> </Transform>
> </xsl:template>
> </xsl:stylesheet>
> ------------------------------------
> 
> When I try to view this in firefox i get this error
> 
> XML Parsing Error: prefix not bound to a namespace
> Location: http://localhost/xml/XSLT%20-%20sunday/artists.xsl
> Line Number 6, Column 2:   
>             <X3D profile="Immersive" 
> xsd:noNamespaceSchemaLocation="http://www.web3d.org/specificat
> ions/x3d-3.0.xsd" 
> version="3.0">
> --------^
> 
> Can anyone help? More information about the project can be 
> found at www.suborg.net --- research
> 
> Thanks and best regards
> 
> J Milo Taylor
> Phd Student
> CRiSAP Research Unit
> London College of Communication

Current Thread