[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Create Table
Hi, B I have an XML file that is exported from a IBM BuildForge.B I am attempting to display as HTML, and could use some guidance.B B The part of the file I am concerned with is the Source Code changes.B There are a series of data nodes that represent either headings or bdiffsb or detail to the headings. The headings are denoted by the attribute section=bchangesb.B Basically, B every time I encounter this section I want to make a new table row and fill the cells with the different value of the element, or I could even create a whole new table.B The problem I am having is testing if a fild is missing, some entries don't have a field="file for example.B In that case I have to leave a blank cell. Here is a sample of the xml: B ThanksB SO much for any help, I am pretty new to this stuff (probably obvious)B B I would also appreciate guidance if I am 'totally ' heading down the wrong road.B :) *******************XML file**********************************************************B <BOM> <server-manifest>B B B B B B B B B B B B B B B B B B B b&b&b&.. Other stuffb&.. b&b&b&b& B B B B B B B B B B B <categoryname="Source Changes"category="Source"> <datalineId="41"section="diff"field="diff">> B B B B B B B B B B B B B B B B B B B B B B if (reportService != null)</data> <datalineId="42"section="diff"field="diff">> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B return true;</data> <datalineId="43"section="diff"field="diff">> B B B B B B B B B B B B B B B B B B B B B B return false;</data> <datalineId="44"section="changes"field="file">.\payx\domain\dev\src\com\paych ex\spr\domain\conversion\task\ConvertHistoryWages.java</data> <datalineId="45"section="changes"field="version">\main\spr2010_apr_dev\2</dat a> <datalineId="46"section="changes"field="date">20100310.102844</data> <datalineId="47"section="changes"field="user">jryan</data> <datalineId="48"section="changes"field="cr_number">602018</data> <datalineId="49"section="changes"field="comment">fix for log 5960</data> <datalineId="50"section="diff"field="diff">1296a1297,1298</data> <datalineId="51"section="diff"field="diff">> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B } else {</data> B b&.Other stuff B *************************************************************************** *************** Here is what I have tried:B Sorry about the messy code, I have been fooling around with it al lot. The Choose statement results in one long row for all data, and doesnbt catch if something is missing. I had trouble forcin a <tr>. I also tried an If statement that comes closer(it creates the correct table, except again it doesnbt catch the entry doesnbt have bdateb value for example.B B I tried nesting an If but it didnbt seem to work.B B <tableborder="1"> B B B B B B B B B B B <tbody> B B B B B B B B B B B B B B B B B B B B B B <tr>B <!--****Static Table Headings***--> B B B B B B B B B B B B B B B B B B B B B B B <th>File</th> B B B B B B B B B B B B B B B B B B B B B B B <th>Version</th> B B B B B B B B B B B B B B B B B B B B B B B <th>Date</th> B B B B B B B B B B B B B B B B B B B B B B B <th>User</th> B B B B B B B B B B B B B B B B B B B B B B B th>CR Number</th> B B B B B B B B B B B B B B B B B B B B B B B <th>Comment</th> B B B B B B B B B B B </tr> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <xsl:for-eachselect="BOM/interface-categories/category[@category='Source']/da ta[@section='changes']"> B B B B B B B B B B B B B B B B <xsl:choose> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <xsl:whentest="current()[@section='changes' and @field='file']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B B B B B B B B B B B B </xsl:when> B B B B B B B B B B B B B B B B B B B B B B B <xsl:whentest="current()[@section='changes' and @field='version']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B B B B B B B B B B B B </xsl:when> B B B B B B B B B B B B B B B B B B B B B B B <xsl:whentest="current()[@section='changes' and @field='date']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B B B B B B B B B B B B </xsl:when> B B B B B B B B B B B B B B B B B B B B B B B <xsl:whentest="current()[@section='changes' and @field='user']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B B B B B B B B B B B B </xsl:when> B B B B B B B B B B B B B B B B B B B B B B B <xsl:whentest="current()[@section='changes' and @field='cr_number']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B B B B B B B B B B B B </xsl:when> B B B B B B B B B B B B B B B B B B B B B B B <xsl:whentest="current()[@section='changes' and @field='comment']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B B B B B B B B B B B B </xsl:when> B B B B B B B B B B B B B B B B B B B B B B B <xsl:otherwise> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td>xxxxxxFigure out a way to leave a blank cellxxxxxx</td> B B B B B B B B B B B B B B B B B B B B B B B </xsl:otherwise> B B B B B B B B B B B B B B B B B B B B B B </xsl:choose> B ****************If statement******************** B <xsl:iftest = "current()[@section='changes' and @field='file']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B B B B B B B B B B B B B B B B B <xsl:iftest="current()[@field!='file']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td>********Not equal to File***********</td> B B B B B B B B B B B B B B B B B B B B B B B B B B B B </xsl:if>B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B </xsl:if> B B B B B B B B B B B <xsl:iftest = "current()[@section='changes' and @field='version']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B </xsl:if> B B B B B B B B B B B <xsl:iftest = "current()[@section='changes' and @field='date']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B </xsl:if> B B B B B B B B B B B <xsl:iftest = "current()[@section='changes' and @field='user']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B </xsl:if> B B B B B B B B B B B <xsl:iftest = "current()[@section='changes' and @field='cr_number']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> B B B B B B B B B B B B </xsl:if> B B B B B B B B B B B <xsl:iftest = "current()[@section='changes' and @field='comment']"> B B B B B B B B B B B B B B B B B B B B B B B B B B B B <td><xsl:value-ofselect="."/></td> <tr/>B B B B B B B B B B B B B B B B </xsl:if>
|
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
|