cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: [XMLForm] Declarative xmlns attribute
Date Wed, 23 Apr 2003 12:32:29 GMT
ivelin wrote:

>Ok, here is what I tried, but not quite sure if it is correct.
>
>AttributesImpl atts;
>if (attributes == null || attributes.getLength() == 0) {
>atts = new AttributesImpl();
>} else {
>atts = new AttributesImpl(attributes);
>}
>startPrefixMapping(NS_PREFIX, NS);
>atts.addAttribute( "", NS_PREFIX, XMLNS_PREFIX + ":" + NS_PREFIX, "CDATA",
>NS);
>attributes = atts;
>
>The gist is that startPrefixMapping is immediately followed by an explicit
>attribute.
>The reason I did this is because without passing an explicit attribute,
>org.apache.xalan.serialize.SerializerToXML does not output it.
>Its startPrefixMappingMethod is:
>
>public void startPrefixMapping(String prefix, String uri)
>throws org.xml.sax.SAXException{}
>

That's the bug with xalan. If you check source of AbstractTextSerializer 
[1] you will see how to circumvent this bug.

Vadim

[1] 
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java?rev=1.4&content-type=text/vnd.viewcvs-markup


>And of course there is a matching endPrefixMapping after endElement.
>
>Is this how it is supposed to work?
>
>
>-=Ivelin=-
>



Mime
View raw message