> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20508

Hello Thorsten,

I applied your patch on my system and tested it. But it's even worse than without the patch :-( It's not your problem, it's because of extreme hacks I guess.

My test stylesheet:
<xsl:template match="/">
<html>
<head>
<title>Test</title>
</head>
<body xmlns:xhtml="http://www.w3.org/1999/xhtml"; xmlns="http://www.w3.org/1999/xhtml"; xmlns:i18n="i18nnamespace">
<xsl:element name="test1" namespace="http://www.w3.org/1999/xhtml"/>
<xsl:element name="test2" namespace="test2"/>
<test3:test3 xmlns:test3="test3"/>
<xhtml:div>test</xhtml:div>
</body>
</html>
</xsl:template>


result using Xalan transformer:
exception on test2 and test3 as expected
output:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
</head>
<body>
<test1></test1>
<xhtml:div>test</div>
</body>
</html>

Logging of element sax events:

startElement[
uri: '', localName:'xhtml:div', raw:'xhtml:div']
endElement[
uri:'http://www.w3.org/1999/xhtml', localName:'div', raw:'xhtml:div']

And using XSLTC:
no exception.
output:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
</head>
<body>
<xhtml:test1></xhtml:test1>
<ns0:test2></ns0:test2>
<test3:test3></test3:test3>
<xhtml:div>test</xhtml:div>
</body>
</html>

element sax events:

startElement[uri: '', localName: 'xhtml:test1', raw: 'xhtml:test1']
endElement  [uri: '', localName: 'xhtml:test1', raw: 'xhtml:test1']
startElement[uri: '', localName: 'ns0:test2',   raw: 'ns0:test2']
endElement  [uri: '', localName: 'ns0:test2',   raw: 'ns0:test2']
startElement[uri: '', localName: 'test3:test3', raw: 'test3:test3']
endElement  [uri: '', localName: 'test3:test3', raw: 'test3:test3']
startElement[uri: '', localName: 'xhtml:div',   raw: 'xhtml:div']
endElement  [uri: '', localName: 'xhtml:div',   raw: 'xhtml:div']

I guess this means everything is handled via prefix mapping. Hmm, we can add a test for ':' in the localName, but this is not the thing I call good programming. But I guess it's ok from SAX' point of view. The xhtml:div with Xalan seems to be a real bug.

Why SAX is so sloppy and careless?

Joerg



Reply via email to