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

Re: Fixing what's broke

  • From: "Pete Cordell" <petexmldev@codalogic.com>
  • To: <liam@w3.org>,"rjelliffe" <rjelliffe@a...>
  • Date: Tue, 7 Dec 2010 09:48:17 -0000

Re:  Fixing what's broke
----- Original Message From: "Liam R E Quin"

> For </> the problem is usually this: in programming code, you can use
> unit tests to gain confidence in correctness. But metadata cannot be
> executed, so it's often harder to catch errors.
> The extra redundancy does seem to help -- if you have an incorrect tag,
> e.g. <author>John Grisham</title>, there's a 50% chance it's the start
> tag and a 50% chance it's the end tag.  So with </> for the end tag, you
> only catch half of these errors :-)

I wouldn't argue that end tags are without benefit*, but in data 
applications where there is a lot of small elements the end tags just bulk 
up the syntax, and (more importantly) make the XML harder to read.

So I'd suggest doing something like:

    <Book:Author>John Grisham</>
    <Book:Title>The Case of the Hidden Claw</>

where the short, single valued elements have a truncated end tag, and the 
complex element has a normal end tag.  An end tag offers little benefit for 
the short values, but offers value for the complex types, where the cost of 
the end tag name is effectively amortized over the elements contained 

Where to use truncated end tags and where not to would be the choice of the 
XML generator; human or machine.

* This is especially the case for XML and HTML compared to program code.  In 
program code we have the option to call methods and functions so our 
construct ends are rarely far from their beginnings.  That's generally not 
an option in XML where there may be many pages within an element (although 
things like PHP/ASP can help with HTML).

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info

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


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.
First Name
Last Name
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.