Hi James, just stumbled accross your message on the mail archive list (am not really on the xindice-dev mailing list, so I don't know if I can post there)
> Ahh.. I thought someone might suggest that. I know Cocoon does things > that way. > they're not the only ones... :-) > There's a problem: Xalan doesn't do what it should with namespaces and that, Alice, greatly depends on where you want to go :-) seriously, what 'should' it do and isn't doing? point is that when serializing SAX the JAXP way you need to behave like a SAXParser of which the setNamespaceAware was false (in other words like an XMLReader that has it's property http://xml.org/sax/features/namespaces set false and http://xml.org/sax/features/namespace-prefixes true (see: http://saxproject.org/?selected=namespaces) which means - you generate no start/end prefixmappings (you can but are ignored) - you need qname and xmlns:* attributes in the startElement event Life would get easier when we would have some kind of XMLFilterImpl that produces these kind of ns-unaware (yet all ns info is there, it's just passed through) SAX events based on more ns-aware SAX Event coming in... my itch hasn't been big enough yet, but if someone starts scratching I'ld be happy to help around my experience with serializing DOM the JAXP way has been somewhat smaller, but as far as I recall the same way of working applies there: make sure the prefixes and required xmlns attributes are set on the nodes in the tree. Here the problem is however that DOM level 2 has no way of normalizing all this distributed namespace information which is a problem if you start assembling DOM trees with parts of other trees were the same ns_uri could be mapped to different prefixes and vice versa hope this clarifies. -marc= > this way of > serializing fails in namespace-intensive documents because of that. The > Xerces serializer > seems to work better (Although if it's the same one, how can this be?) > > So I'm rather reluctant to use that trick... > James > > > -----Original Message----- > > From: Andrius Sabanas [mailto:[EMAIL PROTECTED] > > Sent: 14 May 2002 11:01 > > To: [EMAIL PROTECTED] > > Subject: Re: XML serializing > > > > > > James Bates wrote: > > > I couldn't find any serialization in JAXP... Where is it? > > (That would obviously be better; I agree) > > > > > > Hi, > > > > Serialization in JAXP is done in some strange way - you need to > > transform your Source into StreamResult using null transformer, > > transformerFactory.newTransformer().transform(source, stream) > > > > HTH, > > > > > > Andrius > > > > > > >
