cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Michels <step...@apache.org>
Subject Re: [XMLForm] Declarative xmlns attribute
Date Wed, 23 Apr 2003 06:35:32 GMT

On Tue, 22 Apr 2003, 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.

I think this was a bug of Serializer in the past.

> Its startPrefixMappingMethod is:
>
> public void startPrefixMapping(String prefix, String uri)
> throws org.xml.sax.SAXException{}
>
> And of course there is a matching endPrefixMapping after endElement.
>
> Is this how it is supposed to work?
>

Yes, at moment, must only remove the code from above. You should
already have a prefix mapping, if you transform your xform example.

A problem occur, if you use a different prefix than 'xf'. So
to be sure, you must make a startPrefixMapping in front of
the startTranformingElement.

Stephan.


Mime
View raw message