[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Obfuscating XML with namespaces
Amy Lewis <amyzing@t...> wrote: >Obfuscated xml. Apart from the lengthy URIs, not very. >Tidy refuses to see any errors in it, There aren't any namespace errors in it. (There are two syntax errors in the XML declaration and an unescaped ampersand in one of the URIs.) >I'm not even quite sure what namespace the >most internal foo:element and foo:attribute are in (I think that the >most internal element is in a different namespace than the attribute >that it contains, but I'd hate to swear to it). That's never the case. If an element and one of its attributes have the same prefix, they must be in the same namespace, since they have the same namespace bindings in scope. >What I'd >like to know, then, is: what is the use case for giving namespace >declarations scope? An important reason is to allow you to combine XML documents. Suppose you want to include someone else's XML inside one of your elements. If namespaces weren't scoped, you'd have to check through the included text and change any prefixes that happened to clash with your own. You can check namespace correctness with my XML checker: http://www.cogsci.ed.ac.uk/~richard/xml-check.html If you want to check which namespace an element or attribute is in, get RXP: http://www.cogsci.ed.ac.uk/~richard/rxp.html and use the -N and -b flags, eg rxp -Nb foo.xml -- Richard
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|