I laughed out loud when I read this article on the Daily WTF: http://thedailywtf.com/Articles/WellFormed-XML.aspx , but now it's not funny because I started to recognize this “xml design template” in the wild with alarming frequency. for example, I just exported some data from a reasonable clearquest request, and I got the following:
<?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 am not an xslt master - I will probably figure it out sooner or later, but this cannot stop asking ... what is the simplest xslt template to convert above to 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>
source
share