[jdom-interest] Namespace declaration "gets lost"

Liebig, Stefan Stefan.Liebig at softwareag.com
Wed Oct 16 02:28:56 PDT 2002


Hi,

When parsing the following XML document with JDOM_beta8 and trying to
"analyze" it´s
content, it seems that after the second (redundant but legal, or?) "ino"
namesspace
decl. JDOM gets confused.

<?xml version="1.0" encoding="utf-8" ?>
<ino:response xmlns:ino="http://namespaces.softwareag.com/tamino/response2"
xmlns:xql="http://metalab.unc.edu/xql/">
	<xql:query>
		testUpdate_sli[@ino:id=1]
	</xql:query>
	<ino:message ino:returnvalue="0">
		<ino:messageline>
			XQL Request processing
		</ino:messageline>
	</ino:message>
	<xql:result>
		<testUpdate_sli ino:id="1"
xmlns:ino="http://namespaces.softwareag.com/tamino/response2">
			DOC: -1
		</testUpdate_sli>
	</xql:result>
	<ino:message ino:returnvalue="0">
		<ino:messageline>
			XQL Request processed
		</ino:messageline>
	</ino:message>
</ino:response>

When running the attached JunitTest the output shows the following:

Next message tag
AttributesList:[[Attribute: ino:returnvalue="0"]]
Attribute.name:returnvalue
Attribute.value:0
Attribute.getNS:[Namespace: prefix "ino" is mapped to URI
"http://namespaces.softwareag.com/tamino/response2"]
ReturnValue:0
text:			XQL Request processing		
Next message tag
AttributesList:[[Attribute: returnvalue="0"]]
Attribute.name:returnvalue
Attribute.value:0
Attribute.getNS:[Namespace: prefix "" is mapped to URI ""]
ReturnValue:null
text:			XQL Request processed		

As you can see the second message element has "lost" it´s namespace
and so the "ino:returnvalue" can not be evaluated correctly.
BTW, with Xerces/DOM it is evaluated correctly.

Stefan 

"Technology is just another word for 'it doesn't work yet' " (Douglas Adams)


mailto:Stefan.Liebig at softwareag.com 
http://www.softwareag.com 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: JDomResponseTest.java
Type: application/octet-stream
Size: 4634 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20021016/a71894ce/JDomResponseTest.obj


More information about the jdom-interest mailing list