cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Davis <>
Subject Bug when serializing XML and xmlns=""
Date Sat, 23 Mar 2002 14:01:21 GMT
Hi everybody, I'm new to this list so bear with me...

It started off as one problem, but when I was trying to create a bug report 
for the first I discovered a second.  They both occur between lines 381 and 
394 of org/apache/cocoon/serialization/

The second problem is easier to recreate, so I'll cover it first.  The result 
is this:

Here is a simple XML file that causes the problem:

<page xmlns="foo">
  <test xmlns="">
    this is a test

and the offending code (in

boolean found = false;
for (int attr = 0; attr < attrCount; attr++) {
    if (qName.equals(attrs.getQName(attr))) {
        // Check if mapping and attribute URI match
///*** uri is null here ***///
        if (! uri.equals(attrs.getValue(attr))) {
            getLogger().error("URI in prefix mapping and attribute do not 
match : '" + uri + "' - '" + attrs.g
            throw new SAXException("URI in prefix mapping and attribute do 
not match");
        found = true;

In my sitemap.xmap, I have:
<map:match pattern="the-test-page.xml">
  <map:generate type="file" src="{0}"/>
  <map:serialize type="xml"/>

The other error is prooving really hard for me to reproduce with a 
minimalized example.  I do know that it is caused when I do a transformation 
with Xalan using something like:

<stylesheet version="1.0" xmlns="">
<element name="foo" namespace="">...</element>

I think it might be that Xalan is sending a startPrefixMapping() for the 
<stylesheet> or other XSL elements, and this is confusing the serializer when 
it gets to the <element namespace=""/>.  If I replace <element name="foo" 
namespace=""/> with <foo xmlns=""/>, it works fine.

The error is the SAXException("URI in prefix mapping and attribute do not 
match") from the code above, and the log message is:

URI in prefix mapping and attribute do not match : 
'' - ''

which is why I believe Xalan is confusing the serializer, since the 
XSL/Transform namespace is never output by my stylesheet.

Sorry I can't help to recreate this one further.  Thanks for your help!

Peter Davis
Where's the man could ease a heart
Like a satin gown?
		-- Dorothy Parker, "The Satin Dress"

To unsubscribe, e-mail:
For additional commands, email:

View raw message