[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Global/Local attributes


xhtml a href

> Yes, but there are different rules for namespaces that have a prefix and
> namespaces that don't.  So there is a great deal of difference between the
> "" prefix and the "wibble:" prefix.

You mean the fact that you can't bind the empty prefix for attributes?

> Okay, I will leave out "document namespace". Yes, that's what the default
> namespace is.  Of course, that also just happens to be the same format for
> elements that do not belong to a namespace.

I can't parse that. An element with an unprefixed name is in the default
namespace (which may be null) or more correctly stated, is in the
default namespace if one is declared, or in no namespace.
Your statement that something is teh same format as something else
seems to be suggesting tehre is some ambiguity somewhere?

> But wait!  Now my "attr" has gone from being in the same non-namespace as
> the other elements to being the only thing in the non-namespace. 

Unprefixed attributes are not in a namespace. always. All that means is
that any processing for them can not be specified using a namespace
name as input data. Typically the parent element is used.

"being in the same non-namespace as"

makes no sense there are not multiple non-namespaces so you can't talk
about them being the same (or different).

> I  don't see out you could possibly consider the two documents above
> equivalent.

They are not equivalent.  One has elements in no namespace and one has
elements in http://example.com/ why would you think they should be
equivalent? 

> So, if you have something like the following (from [1]):
That looks like a correct XHTML document.

> This is different from:
yes because that document is incorrect. You can not go xhtml:href
because the XHTML spec does not specify an href attribute that is in the
XHTML namespace.

> The only way to ensure that all xhtml elements and
> attributes are properly in the same namespace are to use a named prefix.

It's a strange use of the word "proper".

<a xmlns="http://www.w3.org/1999/xhtml" href="xxx">xxx</a>

and

<h:a xmlns:h="http://www.w3.org/1999/xhtml" href="xxx">xxx</a>

are equivalent and proper usage of XHTML.

Your example that has href in the same namespace

<h:a xmlns="http://www.w3.org/1999/xhtml" h:href="xxx">xxx</a>

is just wrong and wouldn't be accepted by an XHTML browser.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.