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

Re: [ANNOUNCE] New MicroXML draft available

  • From: Stephen D Green <stephengreenubl@gmail.com>
  • To: John Cowan <cowan@mercury.ccil.org>
  • Date: Thu, 14 Jul 2011 07:11:10 +0100

Re:  [ANNOUNCE] New MicroXML draft available
But say I were to add to my tutorial on MicroXML this
feature of any prefix being allowed in attribute names
(at present it just allows the xml: prefix, as per James
Clark's revised MicroXML spec), this would mean
having to include a lengthy and complex treatment of
XML Namespaces to cater for the fact that, with this
attribute prefix feature, namespace declarations other
than just the simple 'xmlns="..."' will start appearing in
MicroXML documents. Just allowing the xml: attributes
was fine with me; I'm not 100% sure on allowing other
prefixes though. I understand their benefits but the
cost of including 'xmlns:foo="...bar..."' namespace
declarations makes me uncomfortable with them.
 
Cheers
 
Steve

 
----
Stephen D Green



On 13 July 2011 18:56, John Cowan <cowan@mercury.ccil.org> wrote:
Stephen D Green scripsit:

> What is required of a parser handling prefixed and namespaced
> attributes in MicroXML?

Nothing at all, except that attribute names may contain a colon, whereas
element names must not.

The MicroLark parser can provide an object from which element objects
are pulled, or can push element objects to a content handler, or can
construct a tree of element objects.  In any of these cases, one can
use the getNamespace method to search along the ancestor-or-self axis
for the nearest appropriate namespace declaration.  If you think this
is too slow, you can create a subclass of Element that overrides the
getNamespace method to memoize its results, and use an ElementFactory to
tell the parser to instantiate your class rather than Element itself.

(One of the irritating non-features of SAX is that it doesn't expose
the parser's element stack, forcing the application to keep its own.
MicroLark push and pull parsing does expose the stack, though Ghu help
you if you mutate it in any way.)

--
De plichten van een docent zijn divers,         John Cowan
die van het gehoor ook.                         cowan@ccil.org
     --Edsger Dijkstra                         http://www.ccil.org/~cowan



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.