i laughed out loud when i read this article on Daily WTF : http://thedailywtf.com/Articles/WellFormed-XML.aspx, but now it's not funny anymore because i have begun to recognize this "xml design pattern" in the wild with alarming frequency. for example, i just exported some data from a rational clearquest query and i got this:
<?xml version="1.0" encoding="us-ascii"?>
<?xml-stylesheet type="text/xsl" href="http://scm/rational/clearquest/webservice/resultset.xsl"?>
<resultset dbset="CQMaster" dbname="PROD" entitydefname="TR" count="1" name="_my trs">
<header count="3">
<column type="dbid">dbid</column>
<column type="id">id</column>
<column type="short_string">Abstract</column>
</header>
<record>
<field>33607697</field>
<field>PROD00011111</field>
<field>The product has a bug that needs fixed.</field>
</record>
</resultset>
i'm not an xslt wizard - i'll probably figure this out sooner or later, but it can't hurt to ask... what is the simplest xslt pattern to transform the above into something more useful like this:
<?xml version="1.0" encoding="us-ascii"?>
<resultset dbset="CQMaster" dbname="PROD" entitydefname="TR" count="1" name="_my trs">
<record>
<dbid type="dbid">33607697</dbid>
<id type="id">PROD00011111</id>
<Abstract type="short_string">The product has a bug that needs fixed.</Abstract>
</record>
</resultset>