You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Glenn Golden <gg...@umich.edu> on 2001/05/17 19:21:23 UTC

namespaces in attribute values

I'm looking for information about how to deal with namespace references in
an element's attribute's values, as is used in WSDL and in xml schema.  For
example, if making a DOM document from this WSDL xml (this is a fragment):

<?xml version='1.0' encoding='UTF-8'?>
<definitions name="Sessions"
		targetNamespace="urn:CHEF:Sessions"
		xmlns:tns="urn:CHEF:Sessions"
		xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
		xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
		xmlns="http://schemas.xmlsoap.org/wsdl/">

	<!-- messages for the createSession method -->
	<message name="createSessionInput">
		<part name="userId" element="xsd:string"/>
		<documentation>
			The authenticated user's CHEF:userId.
		</documentation>
	</message>

	<!-- ... -->

	<portType name="SessionsPortType">
		<operation name="createSession">
			<input message="tns:createSessionInput"/>
			<!-- ... -->
		</operation>
	</portType>

	<!-- ... -->
</definitions>

Note the <message>, named "createSessionInput", defined in this document's
namespace, and, later, the <portType>, whose <operation>'s <input> "message"
attribue references it using a namespace and name (tns:createSessionInput).

The same for the <message>'s <part>'s "element" attribute, whose value is
"xsd:string" - a reference to another namespace.

What support is there (from the Document object?  The Node? From the
Parser?) for decoding the attribute's value as a reference to some named
thing in a namespace.  How can I, once I get the <input> node and it's
"message" attribute, properly decode the value to the namespace and local
name?

I could re-parse the document looking for all the namespace declarations,
but I'm sure that the DOM parser already has this information (to deal
properly with the element and attributes that may use namespaces).  Is this
surfaced in any way?

I see how to support namespaces in element names, in attribute names, but
not in attribute values.

Thanks!

- Glenn

--------------------------------------------
Glenn R. Golden, Systems Research Programmer
University of Michigan School of Information
ggolden@umich.edu           734-615-1419
http://www-personal.si.umich.edu/~ggolden/
--------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org