Re: How to suppress duplicate xmlns attributes in child nodes?




"david.karr" <davidmichaelkarr@xxxxxxxxx> wrote in message
news:1173382925.352536.62870@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm using JDK 1.4.2 and WebLogic 8.1.4.

I have a situation where we create a blank SOAPMessage object, and
then parse an XML fragment and insert that fragment as the SOAP body.

This works pretty well, but there is one annoyance we see if the root
element of the fragment defines a non-default namespace, and the
elements in the fragment use that prefix.

The problem is that when the SOAPMessage object is marshalled to XML,
that single "xmlns:<prefix>" attribute is present in EVERY element in
the entire XML document. These extra attributes are redundant, as only
the attribute in the root element of the body should be required.

The first question is whether this really matters. It's suboptimal and
probably annoying, but doesn't affect the functioning of your application,
other than

1. Making the messages less human-readable.
2. Making the process of serializing the message, transmitting it to the
remote service, and parsing it there slightly less efficient

If no human tries to read this message, 1 is unimportant, And unless you
can measure the effects of 2, it's not worth worrying about.



.



Relevant Pages

  • How to suppress duplicate xmlns attributes in child nodes?
    ... then parse an XML fragment and insert that fragment as the SOAP body. ... The problem is that when the SOAPMessage object is marshalled to XML, ... exactly what JDOM method is being used). ...
    (comp.lang.java.programmer)
  • Re: xmldocument &quot; and "
    ... > I would be extremly grateful for some help on producing an xml fragemt. ... > string """ to appear in the above fragment. ... > Dim xmlDoc As New XmlDocument ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: XmlDocument.SelectSingleNode XPathException
    ... the XML Node or fragment did include the namespace declaraion. ... this doesn't means that our XPATH can only use "sns" to idenity ...
    (microsoft.public.dotnet.xml)
  • Re: Parsing XML Strings piecewise
    ... >> able to locate parsing errors. ... > Hi Bill, ... The XML fragements arrive from time to time. ... coordination of your fragment source Thread and the parser Thread. ...
    (comp.lang.java.help)