cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@sundn.de>
Subject AW: [C2] RE: Broken examples?
Date Mon, 28 Aug 2000 13:38:18 GMT
> There is some problem with namespaces. If in simple-sql2html.xsl replace
>   <xsl:template match="sql:ROWSET">
> with
>   <xsl:template match="ROWSET">
> and so on  - everything will work.
> 
> Does anybody knows what is wrong with namespaces?
> 
In my opinion it is Xerces, who generates wrong SAX-Events. We have big trouble to write transformers
which use own namespaces as they always get wrong endElement-events. 

I posted a note to this some days ago. For a complete answer here his an excerpt of it:

<<<SNIP>>>
Using the following simple XML-File, Xerces generates wrong endElement()-Events:

<?xml version="1.0"?>

<html xmlns:sql="http://xml.apache.org/cocoon/SQL">
<head>
</head>
<body>

	<sql:execute-query>
		<sql:query>
			select * from user
		</sql:query>
	</sql:execute-query>
</body>
</html>

In version 1.1.3 of Xerves the SQLTransformer receives an endElement() event with uri="http://xml.apache.org/cocoon/SQL",
name="body" and raw="body".
In this case the uri is wrong. The SQLTransformer now gets his namespace and then assumes
body is the value element.

<<<END SNIP>>>
As far as I can see, Xerces 1.1.3 always generates this wrong endElement if the element in
question (here: body) has the default namespace and the element before had another namespace.
Meanwhile somebody (sorry, I lost your mail) has informed the Xerces developer team, so they
should be aware of it.

The current solution (= workaround) is to check the "raw"-attribute of the endElement event.
If it has no prefix, then we assume that the uri-attribute must be null. We know that this
is not absolutely correct, but it works for us very well. It might be that the problem with
your stylesheet is implied by this Xerces-bug.

It might be that the current developer release of Xerces has fixed this bug. I had no time
to check this. And the mailinglists are still down.

HTH

Regards
Carsten Ziegeler

Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================


Mime
View raw message