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

Re: Attribute Order (Was: Create XML )


add attribute to dataset
Simon St.Laurent wrote:


>...
> >
> >I don't see why this is any problem at all. Can you be more specific?
>
> I'm just typing this up with random data, but hopefully you'll get the
> idea:
>
> <table>
> <row item="0001452A" time="08:08.72PM EST" quantity="3" discount="20%"
> tax="7%" base_price="19.99" />
> <row item="1356352A" time="08:09.81PM EST" quantity="1" discount="10%"
> tax="3.5%" base_price="4.99" />
> <row item="BC758333" time="08:12.14PM EST" quantity="1" discount="50%"
> tax="7%" base_price="19.99" />
> <row item="0001452A" time="08:14.09PM EST" quantity="7" discount="0%"
> tax="3.5%" price="1.99" />
> </table>
>
> Is the initial data.  I run a transformation on it which only modifies
> entries with discounts 20% and over, and I might get:
>
> <table>
> <row base_price="19.99" discount="20%" item="0001452A" quantity="3"
> tax="7%" time="08:08.72PM EST" color="pink" />
> <row item="1356352A" time="08:09.81PM EST" quantity="1" discount="10%"
> tax="3.5%" base_price="4.99" />
> <row base_price="19.99"  discount="50%" item="BC758333" time="08:12.14PM
> EST" quantity="1" tax="7%" color="red" />
> <row item="0001452A" time="08:14.09PM EST" quantity="7" discount="0%"
> tax="3.5%" price="1.99" />
> </table>
>
> That's not even that big a change, but finding things in that just got a
> lot harder. (Try it with a thousand rows, twenty attributes, and
> multiple choices of attribute sequence.) Instead of using the
> pattern-matching abilities that humans come with, I now get to write
> code if I want to figure out what's changed.
>

This is an excellent example (I am always willing to be convinced by
concrete evidence :-)

I guess Dare's comment is apropos: Generally 'XML' assumes that human
readable content will be in elements, not attributes. Attributes are
certainly second class citizens in this world.

Perhaps you are correct: there is a use case for an API that preserves more
of the original structure of the XML document, not just attribute order, but
 whitespace, delimeters etc. The price you'll have to pay in order to gain
this capabilty is that you'll either have to figure out how to use (and
implement) something like XSLT on top of your API, or else you'll have to
design and implement a new transformation language designed to work under
these conditions. Either way there are issues, and so we are back to the
cost/benefit ratio.

Another option is to write and use an editor designed to work with tabular
datasets contained in XML documents, or else write stylesheets specific to
each dataset i.e. explicitly place the attributes where you want them.

Lots of choices but I better understand your frustration.

Jonathan


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.