[4suite] DomWriter problem
Uche Ogbuji
uche.ogbuji at fourthought.com
Thu Sep 21 10:01:48 MDT 2000
Alexandre Fayolle wrote:
> > The problem is on this line:
> > new_element.setAttributeNS( extraNss[''],'xmlns','')
> >
> > the new element is 'foo' and at this point, extraNss is {'': 'xsl'}, so
> > we have an non empty namespace-uri. I have the feeling that I completely
> > misunderstood what this parameter stands for when I wrote DowWriter. Could
> > someone enlighten me?
>
> I gave a look at SaxWriter, and the similar piece of code says:
> for prefix in extraNss.keys():
> if prefix:
> self.__currElement.attrs["xmlns:"+prefix] =extraNss[prefix]
> else:
> self.__currElement.attrs["xmlns"] = extraNss['']
>
> If I understand correctly, we would be setting an 'xmlns' attribute, with
> a value of 'xsl' (given the values mentionned above). This would mean that
> the default namespace for the foo element would be 'xsl' ????
>
> Should the line 45 in DomWriter be changed to something like
> new_element.setAttributeNS('','xmlns',extraNss[''])
Ha ha! See my last message. SaxWriter is broken as well. And that's
our code. Ah well.
Thanks for pointing this out.
--
Uche Ogbuji Principal Consultant
uche.ogbuji at fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
More information about the 4suite
mailing list