You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by CP Hennessy <CP...@iname.com> on 2003/03/18 01:23:35 UTC
basic problem with Xalan
Hi,
I'm a new user of Xalan and reasonably new to XML/XSLT.
I'm using the O'Reilly "XML in a nutshell", and trying to get the
basic transformations working.
One of the XSLT examples is similar to the following XML :
<?xml version="1.0"?>
<people>
<person born="1912" died="1954">
<name> <first_name>Alan</first_name> <last_name>Turing</last_name>
</name>
<profession>comp sci</profession>
<profession>math</profession>
</person>
<person born="1923" died="1988">
<name><first_name>Pat</first_name> <last_name>Top</last_name>
</name>
<profession>golf</profession>
<profession>carpenter</profession>
</person>
</people>
and the example ( page 138 example 8.2 )
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transforms" >
</xsl:stylesheet>
and running Xalan gives me :
$ Xalan people.xml t.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transforms"
version="1.0"/>
but the book tells me I should expect :
<?xml version="1.0" encoding="UTF-8"?>
Alan Turing
comp sci
math
Pat Top
golf
carpenter
I even tried using xalan-j but got the following error :
file:///home/yamed/tmp/xalan-j_2_5_D1/bin/../../translate.xsl; Line #2; Column
#82; XSLT Error (javax.xml.transform.TransformerConfigurationException):
javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: stylesheet requires attribute:
version
What am I doing wrong ?
CPH
Re: basic problem with Xalan
Posted by CP Hennessy <CP...@iname.com>.
Doh!
Thanks Don and Dave that was exactly my problem, and it was my
typo not one in the book.
Thank
CPH
RE: basic problem with Xalan
Posted by Don McClimans <dm...@IntiElectronics.com>.
> I'm a new user of Xalan and reasonably new to XML/XSLT.
> I'm using the O'Reilly "XML in a nutshell", and trying to get the
> basic transformations working.
> One of the XSLT examples is similar to the following XML :
<snip>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transforms" >
> </xsl:stylesheet>
Just a typo, it should be Transform, not Transforms.
By the way, I also picked up that book when starting with XSLT, and
discovered that it has a large number of inaccuracies, which confused me
numerous times. It sounds like you have a later version, since my text has
this example on page 131 (vs your reference of page 138), but nonetheless, I
would not recommend it. The "classic" text is XSLT Programmer's Reference by
Michael Kay; it's definitely worth getting.
Don
Re: basic problem with Xalan
Posted by David N Bertoni/Cambridge/IBM <da...@us.ibm.com>.
> and the example ( page 138 example 8.2 )
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transforms" >
> </xsl:stylesheet>
It's either a typo in the book, or a typo in your stylesheet file. The
namespace URI for XSLT is "http://www.w3.org/1999/XSL/Transform", without
the trailing "s".
Dave