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

Re: Attribute Order (Was: Create XML )


dataset creating xml with attribute
jonathan@o... (Jonathan Borden) writes:
>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.

I concluded this morning that one of my first applications for the API
I'm developing will be a toolkit that forces attributes into a
particular element-specific order.  Since Ripper reports the whole
document as text, rearranging them with a filter inside that API and
then just dumping the stream of events as text will let me do that
without modifying the document (entities, etc.) in any other way.  There
are a few quirks to it, mostly around ensuring that entity references in
attributes don't go away when I do this, but it shouldn't be that hard
now that I've built the rest of the foundation.

It's a lot of extra work that I still think could have been avoided at
relatively low cost, but it seems obvious that most programmers creating
XML APIs haven't yet acknowledged these problems and really don't care
to.  If I want a tool, I get to write it myself.  (No, I don't plan to
implement XSLT myself, but I do plan an XPath implementation for MOE at
some point.  Too many projects, too little time.)

>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.

I don't believe XSLT makes any guarantees about the order of attributes
either, though perhaps I'm forgetting something.

>Lots of choices but I better understand your frustration.

Glad to hear it.  I was of the "elements for ordered, atts for
unordered" mindset for a long time before I started hitting cases where
that just wasn't adequate.

-- 
Simon St.Laurent
Ring around the content, a pocket full of brackets
Errors, errors, all fall down!
http://simonstl.com -- http://monasticxml.org

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.