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 08:56:45 GMT

On 23 Apr 2003, Bruno Dumon wrote:

> On Wed, 2003-04-23 at 08:29, Stephan Michels wrote:
> > On Tue, 22 Apr 2003, ivelin wrote:
> >
> > > Good question.
> > > startPrefixMap is somewhat confusing.
> > > http://lists.xml.org/archives/xml-dev/200108/msg00718.html
> > > What is the Xalan error text?
> >
> > ERROR   10510   [test.test] (): Could not execute test
> >     [junit] org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to
> > create or change an object in a way which is incorrect with regard to
> > namespaces.
> >     [junit] 	at
> > org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:351)
> >     [junit] 	at
> > org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1020)
> >     [junit] 	at
> > org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:130)
> >
> >
>
> I found this a bit suspicious, and after looking at Xalan's DOMBuilder I
> think the problem is over there.
>
> The problem is that SAX and DOM have different conventions as to how
> xmlns attributes should be created.
>
> For SAX it is something like:
> atts.addAttribute( "", "", XMLNS_PREFIX + ":" + NS_PREFIX, "CDATA", NS);
>
> (note that the localname and the uri should be empty strings -- see also
> http://www.saxproject.org/?selected=namespaces)
>
> For DOM it is something like:
> element.setAttributeNS("http://www.w3.org/2000/xmlns/", XMLNS_PREFIX +
> ":" + NS_PREFIX, NS);
>
> (thus with the xmlns namespace explicitely mentioned, see
> http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html)
>
> but Xalan's DOMBuilder does not "translate" between these two
> conventions. So to get no error you could do:
> atts.addAttribute("http://www.w3.org/2000/xmlns/", "", XMLNS_PREFIX +
> ":" + NS_PREFIX, "CDATA", NS);
>
> but this would be against SAX conventions.
>
> I'll see if I can patch this in Xalan.

Thank you.

BTW, I got a NotSuchMethodError from your woody block:

10:21:48.060 WARN!! Error for /cocoon/samples/woody/form1
java.lang.NoSuchMethodError
	at
org.outerj.i18n.JdkI18nSupport.getIntegerFormat(JdkI18nSupport.java:34)
	at
org.apache.cocoon.woody.datatype.typeimpl.LongType.convertToStringLocalized(LongType.java:87)
	at
org.apache.cocoon.woody.datatype.StaticSelectionList$SelectionListItem.generateSaxFragment(StaticSelectionList.java:127)


Mime
View raw message