RE: SWAP Example

You're absolutely right.  This is due to my silly error in changing the case
of the namespace prefix to capital "D:".  Also, I was wrong about closing
the </xml> tag.  And, I found a 3rd error:  namespaces are scoped to the
current element and contained elements, so the "z:" namespace in the example
has to be either redeclared for every z: element, or must be declared in
some element which contains all the z: elements.  This revised XML works:

<?xml version="1.0" ?> 
<d:swap xmlns:d="SWAP:"> 
  <d:observer>http://www.ics.uci.edu/pub/ietf/swap/chair.html</d:observer>
   <d:name>equipment-purchase-process</d:name> 
   <d:subject>procurement</d:subject> 
   <d:description>New equipment purchase</d:description> 
   <d:contextData> 
     <z:processor
xmlns:z="http://conf.pcmanufact.com/">pentiumII</z:processor> 
     <z:memory  xmlns:z="http://conf.pcmanufact.com/"> 
       <z:size>256 Meg</z:size> 
       <z:speed>60 ns</z:speed> 
       <z:type>DRAM</z:type> 
     </z:memory> 
   <!-- "name, billing address, etc." --> 
   </d:contextData> 
   <d:startImmediately>no</d:startImmediately><!-- "available?"-->
 </d:swap> 
 
It also works to declare the z: namespace on just the "swap" element, even
though that's not part of the z: namespace.. 

Lisa

-----Original Message-----
From: Richard Heim [mailto:rheim@crusher.jcals.csc.com]
Sent: Thursday, December 03, 1998 5:52 AM
To: Lisa Lippert (Dusseault) (Exchange); 'Gregory Alan Bolcer'
Cc: 'ietf-swap@w3.org'
Subject: RE: SWAP Example


Just a note:
	When I run this example through IE 5.0 (which has XML support), I
get the following error:
Reference to undeclared namespace prefix: 'd'. Line 2, Position 25 
<d:swap xmlns:D="SWAP:">


thanks,
rich heim

> -----Original Message-----
> From:	Lisa Lippert (Dusseault) (Exchange)
> [SMTP:lisal@exchange.microsoft.com]
> Sent:	Wednesday, December 02, 1998 5:38 PM
> To:	'Gregory Alan Bolcer'
> Cc:	'ietf-swap@w3.org'
> Subject:	RE: SWAP Example
> 
> Looks good to me, except you didn't use the current namespace syntax.  Now
> the namespace is declared the first time it is used.  Also don't forget to
> close your xml tag.  Here is the first example fixed up:
> 
> <?xml version="1.0" ?> 
> <d:swap xmlns:D="SWAP:"> 
>   <d:observer>http://www.ics.uci.edu/pub/ietf/swap/chair.html</d:observer>
>   <d:name>equipment-purchase-process</d:name> 
>   <d:subject>procurement</d:subject> 
>   <d:description>New equipment purchase</d:description> 
>   <d:contextData> 
>     <z:processor
> xmlns:Z="http://conf.pcmanufact.com/">pentiumII</z:processor> 
>     <z:memory> 
>       <z:size>256 Meg</z:size> 
>       <z:speed>60 ns</z:speed> 
>       <z:type>DRAM</z:type> 
>     </z:memory> 
>   <!-- "name, billing address, etc." --> 
>   </d:contextData> 
>   <d:startImmediately>no</d:startImmediately><!-- "available?"-->
> </d:swap> 
> </xml>
> 
> 
> Lisa
> 
> 

Received on Thursday, 3 December 1998 15:29:36 UTC