> On Tue, 22 Jun 2004, Matthew J. Dovey wrote:
>
> > > is bad but still legal XML. Bad because once you extract
> the record
> > > from the SRW wrapper, it loses the namespace definitions.
>
> > Err no - the above is both perfectly legal and good XML. In
> fact it is
> > a
>
> I agree that it's legal, but for our purposes it's definitely
> not 'good'
> because those namespaces definitely are NOT inherited by
> records packed as _strings_.
>
> > I suspect that the problem is that you are trying to parser the XML
> > document as an text document rather than an XML document.
>
> No, as above.
>
> And even if I was, the SOAP toolkit which does this parsing
> may or may not respect it and that's not something in my
> control. (Mine does, but I obviously make no guarantees about others)
OK - agreed that *if* the xmlns is "opaque" to the XML document (because
it has been packed into a strings) then the xmlns should be in the
packed string.
However, if the record is being passed as XML then there can be no
guarantees where the namespaces get defined. Even if the SRW server has
followed some SRW convention, an intermediary might have reparsed the
XML and moved the namespace definitions elsewhere - for example there
are now a number of WebService firewalls on the market which might read
the XML and sign it. They would necessary convert the XML to canonical
XML (which would move the xml declarations to the root element).
Even if there wasn't an intermediary - I might want to sign my SRW
responses (which would mean violating any convention to put namespace
definitions on the innermost element).
Matthew
P.S. having written the above, the situation of having a signed XML
fragment within a larger XML document sprung to mind - not too sure how
that would be handled, I'll need to do some digging...
|