SOAP serialization fails to prefix namespace declarations

RESOLVED WORKSFORME

Status

()

Core
XML
RESOLVED WORKSFORME
17 years ago
16 years ago

People

(Reporter: Ray Whitmer, Assigned: Ray Whitmer)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

17 years ago
This appears to be a bug in the DOM serialization code.  As long as there is a
namespace defined for each namespaceURI in the tree, the prefixes are correctly
associated as the tree is serialized.  But if a namespaceURI is missing, no new
namespace declaration is created by the serializer.  SOAP currently manually
makes declarations for certain cases including:

SOAP envelope.
SOAP encoding.
XML Schema
XML Schema instance
Namespace declarations (xmlns).
Attribute values (not names) that are namespace qualified.
The main method in an rpc-style message.

Uncovered cases deal primarily with alternate encodings or explicit use of
additional types -- so we need to create test cases soon for these.

If a different namespaceURI is used in one of these places, then no prefix is
attached even though it is namespace-qualified.  We need to either:

1.  Fix the serializer.
2.  Add prefix computation for all additional creation of nodes with
namespaceURI and without prefixes within the tree.
(Assignee)

Comment 1

17 years ago
I intended to assign this to myself.
Assignee: heikki → rayw
(Assignee)

Comment 2

17 years ago
Adding Johnny since he probably he knows about the serializer and whether we
should log a bug there.
(Assignee)

Comment 3

17 years ago
I have gone back and been unable to reproduce most of the problems that I was
having before, so I will assume I was doing something wrong.

The only problem I WAS able to produce is one the DOM working group is still
discussing right now:

If I create a namespace declaration, by using the URI
"http://www.w3.org/2000/xmlns/", but I do not attach the xmlns prefix, then the
serializer also does not attach the xmlns: prefix, but fails to fixup the prefix
of attributes that need that declaration.

The debate is whether you are required to attach the prefix manually in this
case, or whether the URI is enough to indicate a namespace declaration.  My
position is that the URI should be enough, but the DOM WG is still discussing
this, I believe.

To dup the problem in the current code, edit
/mozilla/extensions/xmlextras/soap/src/nsSOAPMessage.cpp and search for use of
the string kXMLNamespacePrefix, where it is being pre-ended to
nsSOAPUtils::kXSIURI.  Change the code to not prepend, and then try a SOAP
example such as soapisprimenumber.html, which used to work, and you will see
that xsi:type attributes are missing the xsi: prefix, and the namespace
declaration is missing the xmlns: prefix.  (You have to compile with MOZ_SOAP=1
and if compiled in debug mode, the actual XML requests are echoed to the
standard output).
Summary: SOAP's serialization fails to prefix elements and attributes → SOAP serialization fails to prefix namespace declarations
(Assignee)

Comment 4

17 years ago
This bug is really logged against the wrong product.  I will close it since the
original problem cannot still be duplicated.  comment #3 still describes a
problem, but I will report it again when the DOM WG has figured out what should
occur, and not as a SOAP problem, since SOAP works.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → WORKSFORME

Updated

16 years ago
QA Contact: petersen → rakeshmishra
You need to log in before you can comment on or make changes to this bug.