|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Attribute Order (Was: Create XML )
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








