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

Re: Simple SAX2 Proposal, v3.

  • From: Petr Cimprich <petr@g...>
  • To: "'xml-dev@l...'" <xml-dev@l...>
  • Date: Fri, 31 Aug 2001 15:28:43 +0200

simple of proposal
First of all I want to say I like this version of proposal.

Ad $name/{}$name: the first way would allow to keep SAX2 generators 
compatible with SAX1, that's the only benefit I can see. I think this 
"benefit" can be traded off against a consistency of the second way.

But I have another question. start_cdata() has an empty argument in 
current binding and data itself is provided by another call of 
characters(). What is reason for this? Passing {Data  => $data}directly 
in start_cdata() would make the communication between SAX and DOM more 
straightforward and just one function would be called instead of three. 
Am I missing anything?

Petr

Matt Sergeant wrote:

>This time, much smaller changes from the current PerlSAX2 proposal...
>
>Following discussions with Ken MacLeod on IRC and thinking about what we
>might need to do with attributes in the future (i.e. add more properties to
>them), here's what I've come up with:
>
>1. Rather than Attributes being keyed by [$ns, $local] or $qname, depending
>on context, they are just plain hashrefs keyed by "{$ns}$local". The
>so-called James Clark notation. The values are hashref objects representing
>the attribute nodes, with Prefix, Name, LocalName and NamespaceURI
>properties, much like the element nodes.
>
>Gone are InScopeNSMap (it's pointless if you have attributes having their
>own Prefix and NSURI properties) and autovivication issues. Also gone is my
>start/end ns events, as they were already in the advanced part of the
>PerlSAX2 proposal.
>
>This is a very simple change to the current SAX2 spec, but makes it
>infinitely easier for developers to write SAX2 generators.
>
>It's a little more complex to use than the previous proposal of mine, in
>that to get at the value you have to access the Value property. But this is
>no more complex than having to access the Data property to get at the text
>being passed to the characters() callback.
>
>The downside, I suppose, is that keys %{$e->{Attributes}} is pretty
>meaningless except to iterate over the attributes (in which case you should
>probably just use values()), but that's a small price to pay.
>
>Here's your element node with this scheme:
>
>  {
>	Name => "item",
>	LocalName => "item",
>	NamespaceURI => "http://example.com/a",
>	Prefix => "",
>	Attributes =>
>		{
>		"{http://example.com/b}id" => 
>			{ Name => "b:id",
>			  LocalName => "id",
>			  Prefix => "b",
>			  NamespaceURI => "http://example.com/b",
>			  Value => "352"
>			},
>		"flirble" =>
>			{ Name => "flirble",
>			  LocalName => "flirble",
>			  Prefix => "",
>			  NamespaceURI => "",
>			  Value => "wangle"
>			},
>		"blurb" =>
>			{ Name => "blurb",
>			  LocalName => "blurb",
>			  Prefix => "",
>			  NamespaceURI => "",
>			  Value => "Hello World"
>			},
>		},
>  }
>
>Matt.
>
>________________________________________________________________________
>This email has been scanned for all viruses by the Star Internet Virus Screen.
>The service is provided in partnership with MessageLabs, the email security company.
>For more information on a higher level of virus protection visit www.star.net.uk
>________________________________________________________________________
>_______________________________________________
>Perl-XML mailing list
>Perl-XML@l...
>http://listserv.ActiveState.com/mailman/listinfo/perl-xml
>

-- 
Petr Cimprich
Ginger Alliance
www.gingerall.com




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.