[jdom-interest] Namespace issues, et al.

Malachi de AElfweald malachi at tremerechantry.com
Sun Feb 23 14:26:16 PST 2003


I am confused as well. My Schema (based off the one at w3schools) does not 
explicitely mention the namespace except for
in the root element. I am not using xpath in it directly... the top of my 
schema:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://www.temporal-wave.com/spec"
	xmlns="http://www.temporal-wave.com/spec"
	elementFormDefault="qualified">
<xsd:element name="objex">
	<xsd:complexType>
		<xsd:choice>
			<xsd:element name="request">
				<xsd:complexType>
					<xsd:choice>
						<xsd:element name="jedi" type="jediReq"/>
						<xsd:element name="jconnection" type="jconnectionReq"/>
					</xsd:choice>
					<xsd:attribute name="session" type="xsd:string"/>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="response">
				<xsd:complexType>
					<xsd:choice>
						<xsd:element name="selectList" type="selectListResp"/>
						<xsd:element name="confirmation" type="confirmationResp"/>
						<xsd:element name="record" type="recordResp"/>
						<xsd:element name="call" type="callResp"/>
					</xsd:choice>
					<xsd:attribute name="session" type="xsd:string"/>
				</xsd:complexType>
			</xsd:element>
		</xsd:choice>
	</xsd:complexType>
</xsd:element>
..... pages more here.....

and an example XML conforming to said Schema:
<?xml version="1.0" encoding="UTF-8"?>
<objex xmlns="http://www.temporal-wave.com/spec"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.temporal-wave.com/spec jbase.xsd">
	<request session="1234567890987654321">
		<jedi name="myData">
			<read recordKey="data001" blockedRead="true" attributeNum="3"/>
		</jedi>
	</request>
</objex>

Now, this validates fine using Xerces directly.... doesn't validate with 
JDOM at all (see previous bug report comment).
but, the request tag is <request session=""/> NOT <jbase:request 
jbase:session=""/>.... and it works fine as long as I
don't use JDOM to CREATE it.... I can validate it with Xerces, and I can 
read it with JDOM... can NOT create it though.

Malachi



On Sun, 23 Feb 2003 14:00:23 -0800, Robert Koberg <rob at koberg.com> wrote:

> I'm confused :(
>
> This is a bad example, but say you have something like:
>
> <x:html xmlns:x='http://www.w3.org/1999/xhtml'>
> <x:head><x:title>Frobnostication</x:title></x:head>
> <x:body><x:p>Moved to <x:a href='http://frob.com'>here</x:a>.</x:p>
> <x:div>
> <x:key uri="http://frob.com"/>
> </x:div>
> </x:body>
> </x:html>
>
> And then in your XML Schema you have (in the body element defintion):
>
> <xs:key name="x_uris">
> <xs:selector xpath=".//x:key"/>
> <xs:field xpath="@uri"/>
> </xs:key>
> <xs:keyref name="uri_refs" refer="x_uris">
> <xs:selector xpath=".//x:a"/>
> <xs:field xpath="@x:href"/>
> </xs:keyref>
>
> You need the namespace on the attribute for the xs:field for the keyref. 
> So it
> is in the the same space, right?
>
> sorry about the/my confusion,
> -Rob
>
>> -----Original Message-----
>> From: jdom-interest-admin at jdom.org
>> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Elliotte Rusty Harold
>> Sent: Sunday, February 23, 2003 1:29 PM
>
>> At 12:53 PM -0800 2/23/03, Malachi de AElfweald wrote:
>> >One of the examples on http://www.w3.org/TR/xml-names11/
>> >is:
>> >
>> ><?xml version="1.1"?>
>> ><!-- elements are in the HTML namespace, in this case by default -->
>> ><html xmlns='http://www.w3.org/1999/xhtml'>
>> >  <head><title>Frobnostication</title></head>
>> >  <body><p>Moved to <a href='http://frob.com'>here</a>.</p></body>
>> ></html>
>> >
>> >So, you all are saying the "href" is not in the
>> >http://www.w3.org/1999/xhtml namespace?
>>
>>
>> Yes, that is exactly what we (and the spec) are saying
>
>
>
>



-- 
 



More information about the jdom-interest mailing list