[jdom-interest] First pass at Namespace revision[eg]

Jason Hunter jhunter at collab.net
Thu Mar 29 21:56:28 PST 2001


Your logic looks generally right, but <cc:ddd3> would generate an error,
because there's no xmlns:cc.  Same for <pp:bbb4>.

-jh-

"Steven D. Keens" wrote:
> 
> It seems the namespace spec. is unclear or I have interpreted it all
> wrong.  I read it a couple of weeks ago and surmised that
> namespaces have similar scoping rules as automatic/temporary
> variables in C++ and Java.  Now I may have gotten this impression
> from the preconceived notion of what I thought namespaces should be.
> So to clarify my interpretation here's my whack at it.
> 
> Given the fragment:
> 
> <aaa xmlns:p1="http://namespace_p1">
>   <bbb1 />
> 
>   <bbb2 xmlns="http://default_ns_1"  xmlns:p2="http://namespace_p2" >
>     <ccc1 xmlns="http://default_ns_2">
>       <p2:ddd1 />
>       <ddd2 />
>     </ccc1>
>   </bbb2>
> 
>   <p1:bbb3 xmlns:p3="http://namespace_p3" >
>     <ccc2>
>       <cc:ddd3 xmlns="http://default_ns_3">
>         <eee />
>       </p3:ddd3>
>       <ddd4 />
>     </ccc2>
>   </p1:bbb3>
> 
>   <pp:bbb4>
>   </pp:bbb4>
> </aaa>
> 
> Here's a table linking each element to its namespacee URI.
> It's in the same order as the elements above.
> 
> Element              Namespace URI
> --------------------------------------------
> <aaa>                NONE
> <bbb1>               NONE
> <bbb2>               http://default_ns_1
> <ccc1>               http://default_ns_2
> <p2:ddd1>            http://namespace_p2
> <ddd2>               http://default_ns_2
> <p1:bbb3>            http://namespace_p1
> <ccc2>               NONE
> <cc:ddd3>            http://namespace_p3
> <eee>                http://default_ns_3
> <ddd4>               NONE
> <pp:bbb4>            NONE
> 
> Here's the same table ordered by URI.
> 
> Element              Namespace URI
> --------------------------------------------
> <aaa>                NONE
> <bbb1>               NONE
> <ccc2>               NONE
> <ddd4>               NONE
> <pp:bbb4>            NONE
> 
> <bbb2>               http://default_ns_1
> 
> <ccc1>               http://default_ns_2
> <ddd2>               http://default_ns_2
> <eee>                http://default_ns_3
> 
> <p1:bbb3>            http://namespace_p1
> <p2:ddd1>            http://namespace_p2
> <cc:ddd3>            http://namespace_p3
> 
> Does this seem right?  I've tried to show all the different
> possibilities but I've probably forgotten a couple.
> 
> --
> Steven Keens                mailto:skeens at planetfred.com
> PlanetFred Inc.             http://www.planetfred.com
> 44 Byward Market, Suite 240, Ottawa, ON, K1N 7A2, Canada
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list