Re: How to suppress duplicate xmlns attributes in child nodes?
- From: "Mike Schilling" <mscottschilling@xxxxxxxxxxx>
- Date: Fri, 09 Mar 2007 06:27:39 GMT
"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.
.
- References:
- How to suppress duplicate xmlns attributes in child nodes?
- From: david.karr
- How to suppress duplicate xmlns attributes in child nodes?
- Prev by Date: Re: Hibernate: having trouble saving a LIST of objects to database.
- Next by Date: Re: Getting client IP address
- Previous by thread: How to suppress duplicate xmlns attributes in child nodes?
- Next by thread: JRE 1.2 Daylight Savings Time Fix
- Index(es):
Relevant Pages
|