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

Re: Namespace declaration versus attribute


attribute xmlns not recognized
Amy! Lewis wrote:
> Totay.  Lessee if I can present this any better.

	Umm, not quite.

> Given the following DTD:

	 Note that DTDs, being XML 1.0, are blissfully
Namespace-agnostic...

> <!ELEMENT root( #PCDATA)>
> 
> and given XML 1.0, pre-Namespaces processing, the following instance is
> DTD-invalid:
> 
> <root xmlns="scheme://auth/path">text</root>
> 
> This is because the DTD does not include an xmlns attribute in the root
> element content model.

	Correct.

> The following example, under the same processing conditions is also
> DTD-invalid:
> 
> <ns:root xmlns:ns="scheme://auth/path">text</ns:root>
> 
> In this case, the "ns:root" element is not recognized.

	Correct.

> Add namespace-awareness to the processor, and both examples are now
> DTD-valid.

	Nope.  Since the DTD hasn't changed, and DTD validation
pays no attention to Namespaces, both are still invalid.
To make the first valid, you'd have to have an attribute
declaration for xmlns.  To make the second valid, you'd have
to change the element declaration to ns:root and add the
attribute declaration for xmlns:ns.  Additionally, with some
varieties of MS parser, I believe you need to make the xmlns
attributes #FIXED.

-- 
Kian-Tat Lim, ktl@k..., UTF-7: +Z5de+pBU-

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.