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:Book> <Book:Author>John Grisham</> <Book:Title>The Case of the Hidden Claw</> </Book:Book> 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 within. 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]
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