Capella XHTML tables are not properly handled by M2Doc - m2doc

I am using tables in Capella descriptions and found out that M2Doc fails at handling properly merged cells.
Here is an example of what I have in a Capella description:
<table border="1" bordercolor="#000000" cellpadding="2" cellspacing="1" dir="LTR" width="172">
<tbody>
<tr>
<td colspan="1" height="19" rowspan="2" width="50%">
<p align="CENTER">test</p>
</td>
<td height="19" width="50%">
<p align="LEFT"><font face="Calibri" size="3"><font face="Calibri" size="3">c</font></font></p>
</td>
</tr>
<tr>
<td height="19" width="50%">
<p align="LEFT"><font face="Calibri" size="3"><font face="Calibri" size="3">d</font></font></p>
</td>
</tr>
<tr>
<td height="19" width="50%">
<p align="LEFT"><font face="Calibri" size="3"><font face="Calibri" size="3">a</font></font></p>
</td>
<td height="19" width="50%">
<p align="LEFT"><font face="Calibri" size="3"><font face="Calibri" size="3">e</font></font></p>
</td>
</tr>
<tr>
<td height="19" width="50%">
<p align="LEFT"><font face="Calibri" size="3"><font face="Calibri" size="3">b</font></font></p>
</td>
<td height="19" width="50%">
<p align="LEFT"><font face="Calibri" size="3"><font face="Calibri" size="3">f</font></font></p>
</td>
</tr>
</tbody>
Table in Capella
The result in Word is the following:
enter image description here
Is that a known bug? I have used an online editor (link towards XHTML tool) to check the validity of the Capella XHTML code and it is valid. Therefore, I have the feeling it is the conversion to Word that is faulty.
Thank you very much,
Stephane

Merged cells are supported by M2Doc:
https://github.com/ObeoNetwork/M2Doc/blob/4cb5e1a2d852f1ec0e678906ae3bbcee791fa418/plugins/org.obeonetwork.m2doc/src/org/obeonetwork/m2doc/element/MTable.java#L169
But it is not used by the HTML service. I opened the following issue:
https://github.com/ObeoNetwork/M2Doc/issues/460

Related

Get verification code from a html string code using regex

I am currently writing an automation script, Where I read email Gmail through API and i am getting below html content. Now i need only code 191418 from this html content, I want to take it using regex. I tried with this
.*([0-9]{6})
To find 6 digit code but its returns 10 matchings, I am not good at regex, Can someone please help me to get the code using regex?
<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><u></u>
<div>
<center id="m_-2051398760120817894wrapper">
<table id="m_-2051398760120817894main" width="100%">
<tbody><tr id="m_-2051398760120817894logo">
<td>
<table width="100%">
<tbody><tr>
<td>
<img src="test.com/logo.png" width="140px" alt="xxxxx Logo" style="padding:0 10px">
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td height="18px"></td>
</tr>
<tr id="m_-2051398760120817894header">
<td>
<table width="100%">
<tbody><tr>
<td height="64px" style="background-color:#10069f;color:#fff;padding-left:24px;font-weight:700">Reset your password</td>
</tr>
</tbody></table>
</td>
</tr>
<tr id="m_-2051398760120817894content">
<td>
<table width="100%">
<tbody><tr>
<td style="background-color:#f6f5ff;padding:24px 24px 16px 24px">
<p style="margin-top:0">The following is the verification code required to complete your password reset.</p>
<p style="margin-bottom:24px">Enter the following verification code on the screen during the registration, and proceed to the next step.</p>
<div style="display:block;text-align:center;margin-bottom:8px;background-color:#fff;height:92px;font-weight:600;font-size:36px;line-height:92px">191418</div>
<span style="display:block;font-size:12px;color:#5d5d5d">*The verification code is valid only for 24 hours.</span>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td height="24px"></td>
</tr>
<tr id="m_-2051398760120817894footer">
<td>
<table width="100%">
<tbody><tr>
<td style="background-color:#6d7777;padding:16px 24px;font-size:12px;color:#fff">
<table width="100%">
<tbody><tr>
<td id="m_-2051398760120817894footer-left">
<span style="display:block">amnimo Inc.</span>
<span style="display:block">0-3-30 usaa-fso, xxxxxxxx-shi, Tokyo, 180-8750, Japan</span>
<span style="display:block">Phone: +81-422-52-6779</span>
<span id="m_-2051398760120817894copyright-mb" style="margin-top:16px">© 2020 <div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><u></u>
<div>
<center id="m_-2051398760120817894wrapper">
<table id="m_-2051398760120817894main" width="100%">
<tbody><tr id="m_-2051398760120817894logo">
<td>
<table width="100%">
<tbody><tr>
<td>
<img src="https://test.com/logo.png" width="140px" alt="Amnimo Logo" style="padding:0 10px">
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td height="18px"></td>
</tr>
<tr id="m_-2051398760120817894header">
<td>
<table width="100%">
<tbody><tr>
<td height="64px" style="background-color:#10069f;color:#fff;padding-left:24px;font-weight:700">Reset your password</td>
</tr>
</tbody></table>
</td>
</tr>
<tr id="m_-2051398760120817894content">
<td>
<table width="100%">
<tbody><tr>
<td style="background-color:#f6f5ff;padding:24px 24px 16px 24px">
<p style="margin-top:0">The following is the verification code required to complete your password reset.</p>
<p style="margin-bottom:24px">Enter the following verification code on the screen during the registration, and proceed to the next step.</p>
<div style="display:block;text-align:center;margin-bottom:8px;background-color:#fff;height:92px;font-weight:600;font-size:36px;line-height:92px">191418</div>
<span style="display:block;font-size:12px;color:#5d5d5d">*The verification code is valid only for 24 hours.</span>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td height="24px"></td>
</tr>
<tr id="m_-2051398760120817894footer">
<td>
<table width="100%">
<tbody><tr>
<td style="background-color:#6d7777;padding:16px 24px;font-size:12px;color:#fff">
<table width="100%">
<tbody><tr>
<td id="m_-2051398760120817894footer-left">
<span style="display:block">test Inc.</span>
<span style="display:block">2-9-32 ssdsa-sss, puakano-shi, Tokyo, 000-8000, Japan</span>
<span style="display:block">Phone: +81-000-00-652</span>
<span id="m_-2051398760120817894copyright-mb" style="margin-top:16px">© 2020 amnimo Inc.</span>
</td>
<td id="m_-2051398760120817894footer-right">
<span style="display:block">© 2020 amnimo Inc.</span>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</center>
</div>
</div></div> Inc.</span>
</td>
<td id="m_-2051398760120817894footer-right">
<span style="display:block">© 2020 test Inc.</span>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</center>
</div>
</div></div>
You should use some DOM library that will let you query the element you want and get its content. Parsing HTML with regex is bad idea.
If you must do it, getting six numbers is not enough - after inspecting, I see that it's div content. So I would write something among the lines:
<div[^>]*>\d{6}<\/div>
Pattern explanation:
<div - match <div literally
[^>]* - match zero or more characters other from >
> - match > literally
\d{6} - match 6 digits
<\/div> - match <\/div> literally
Regex demo
EDIT
In order to extract desired text, use capturing groups:
<div[^>]*>(\d{6})<\/div>
Then text in first capturing group will be your desired result.
Maybe try word boundaries, which will prevent matching inside longer numbers:
\b([0-9]{6})\b
https://regex101.com/r/dQAiHU/1/

How to display product variant in report?

I have create a custom module for sale order report . In my case, articles have attributes that have more then one value for example color: red, blue. I want to display in the article description the value of the variants. I tried several code but I did not get the right result either it displays all the value of an attribute.Any idea for help please?
report_saleorder.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data> ...
<table class="table table-condensed" style="margin-top:25px;">
<thead>
<tr>
<th>N°</th>
<th>REFERENCE</th>
<th>DESCRIPTION</th>
<th class="text-left">QTE</th>
<th class="text-left">PRIX UHT</th>
<th t-if="display_discount" class="text-left"
groups="sale.group_discount_per_so_line">
REMISE (%)
</th>
<th>TOTAL NET HT</th>
<th class="text-left">TVA</th>
</tr>
</thead>
<tbody class="sale_tbody">
<t t-foreach="doc.order_line" t-as="l">
<tr t-if="l.product_uom_qty">
<td>
<span t-esc="str(l_index+1)"/>
</td>
<td>
<span t-field="l.product_id.default_code"/>
</td>
<span t-field="value.name"/>
<td style="width:50%;">
[<span t-field="l.product_id.name"/>]
<br/>
<t t-foreach="l.product_id.attribute_line_ids" t-as="variant">
<!-- - -->
<strong><span t-field="variant.attribute_id"/>:
</strong>
<t t-foreach="variant.value_ids" t-as="value">
<!--<span t-field="variant.value_ids.name"/>-->
<span t-field="value.name"/>
<!--<br/>-->
</t>
</t>
<span t-field="l.product_id.description_sale"/>
<td class="text-left" style="width:7%;">
<span t-esc="'%.f'%(l.product_uom_qty)"/>
<!--<span groups="product.group_uom" t-field="l.product_uom"/>-->
</td>
<td class="text-left" style="width:12%;">
<span t-field="l.price_unit"/>
</td>
<td t-if="display_discount" class="text-left"
groups="sale.group_discount_per_so_line" style="width:11%;">
<span t-esc="'%.f'%(l.discount)"/>
</td>
<td style="width:15%;">
<span t-field="l.price_subtotal"/>
</td>
<td class="text-left" style="width:9%">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.tax_id))"/>
</td>
</tr>
</t>
</tbody>
</table>
This question is similar and somehow a duplicate of:
(odoo10) how to add product attributes in pdf invoice
See how to do it there

Regex - How to properly grab nested value

I understand parsing html with a regex isn't ideal, but I have a use case for it.
I have this coverage report/html page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LCOV - .info.cleaned</title>
<link rel="stylesheet" type="text/css" href="gcov.css">
</head>
<body>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="title">LCOV - code coverage report</td></tr>
<tr><td class="ruler"><img src="glass.png" width=3 height=3 alt=""></td></tr>
<tr>
<td width="100%">
<table cellpadding=1 border=0 width="100%">
<tr>
<td width="10%" class="headerItem">Current view:</td>
<td width="35%" class="headerValue">top level</td>
<td width="5%"></td>
<td width="15%"></td>
<td width="10%" class="headerCovTableHead">Hit</td>
<td width="10%" class="headerCovTableHead">Total</td>
<td width="15%" class="headerCovTableHead">Coverage</td>
</tr>
<tr>
<td class="headerItem">Test:</td>
<td class="headerValue">.info.cleaned</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">399</td>
<td class="headerCovTableEntry">1019</td>
<td class="headerCovTableEntryLo">39.2 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2016-11-07</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">22</td>
<td class="headerCovTableEntry">67</td>
<td class="headerCovTableEntryLo">32.8 %</td>
</tr>
<tr><td><img src="glass.png" width=3 height=3 alt=""></td></tr>
</table>
</td>
</tr>
<tr><td class="ruler"><img src="glass.png" width=3 height=3 alt=""></td></tr>
</table>
<center>
<table width="80%" cellpadding=1 cellspacing=1 border=0>
<tr>
<td width="50%"><br></td>
<td width="10%"></td>
<td width="10%"></td>
<td width="10%"></td>
<td width="10%"></td>
<td width="10%"></td>
</tr>
<tr>
<td class="tableHead">Directory <span class="tableHeadSort"><img src="glass.png" width=10 height=14 alt="Sort by name" title="Sort by name" border=0></span></td>
<td class="tableHead" colspan=3>Line Coverage <span class="tableHeadSort"><img src="updown.png" width=10 height=14 alt="Sort by line coverage" title="Sort by line coverage" border=0></span></td>
<td class="tableHead" colspan=2>Functions <span class="tableHeadSort"><img src="updown.png" width=10 height=14 alt="Sort by function coverage" title="Sort by function coverage" border=0></span></td>
</tr>
<tr>
<td class="coverFile">src</td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="ruby.png" width=39 height=10 alt="39.2%"><img src="snow.png" width=61 height=10 alt="39.2%"></td></tr></table>
</td>
<td class="coverPerLo">39.2 %</td>
<td class="coverNumLo">399 / 1019</td>
<td class="coverPerLo">32.8 %</td>
<td class="coverNumLo">22 / 67</td>
</tr>
</table>
</center>
<br>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="ruler"><img src="glass.png" width=3 height=3 alt=""></td></tr>
<tr><td class="versionInfo">Generated by: LCOV version 1.10</td></tr>
</table>
<br>
</body>
</html>
I am attempting to parse out the data from this line:
<td class="headerCovTableEntryLo">39.2 %</td>
as 39.2 (a float value).
I am currently using this regex to find two matching TD's:
<td class="headerCovTableEntryLo">[0-9.].*?.%<\/td>
I'm misunderstanding how groups work. I tried:
(<td class="headerCovTableEntryLo">[0-9.].*?.%<\/td>)[0-9.].*?\1
To take what was found in the first group and grab just the numberical values but I have zero matches. Can anyone lend some insight into what I am doing wrong?
Is this what you want to perform? (capture only the floating value):
<(td) class="headerCovTableEntryLo">([0-9.]+)\s?%<\/\1>
see it working here: https://regex101.com/r/qprROm/2
If so, if you try to reuse the first match you're making correct use of it with \1 or to etc to match which captured group. but in your trial you also captured the class which wont match in closing tag.
Not sure this is really what you try to do though. haha
Plus, in this case doing <(td)>(.*?)<\/\1> does not really make sense. It is more usefill if your usecase is something like this <(td|th|tr)>(.*?)<\/\1>
In the end if I was doing it I would rather do it this way for more flexibility: (?<=class="headerCovTableEntryLo">)([0-9.]+)(?=\s?%)
See it working here: https://regex101.com/r/qprROm/3

Code after CFInclude seems to disappear or is not rendered

Having some issues with a ColdFusion application here. I'm trying to add in a <cfinclude template="header.cfm"/> and it renders correctly however the rest of the cf code seems to disappear, not sure if its not being rendered or just not showing up because of the cfinclude statement running. This is for a page header I'm trying to insert.
Is there a way to insert the cfincludes and have it stop so the rest of the page can process? Does my question make sense?
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="header.png" fwbase="default.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="1" -->
<tr>
<td><img name="grantpro" src="images/grantpro.gif" width="411" height="80" border="0" alt=""></td>
<td><img name="gpimage" src="images/gpimage.jpg" width="189" height="80" border="0" alt=""></td>
</tr>
<tr>
<td colspan="2" align="center">
<table width="599px" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="4"><div align="center"><font size="5"><strong>FDC Menu</strong></font></div></td>
</tr>
<td colspan="3"><strong>FDC Pending Proposals:</strong></td>
</tr>
<tr>
<td> </td>
<td colspan="2">By Applicant Name</td>
</tr>
<tr>
<td> </td>
<td colspan="2">By Grant Type</td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="3"><strong>FDC Funded Proposals:</strong></td>
</tr>
<tr>
<td> </td>
<td colspan="2"><strong><em>Current Year</em></strong></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>By Applicant Name</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>By Grant Type</td>
</tr>
<tr>
<td> </td>
<td colspan="2"><em><strong>Prior Years</strong></em></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>By Applicant Name </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>By Grant Type</td>
<cfinclude template="cssmenu/header.cfm"/>
</table>
<p align="center"><strong>Logout</strong></p> </td>
The following code shows where the problem is
<tr>
<td> </td>
<td> </td>
<td>By Grant Type</td>
<cfinclude template="cssmenu/header.cfm"/>
</table>
Solution 1:
This is the recommended solution
The <cfinclude> probably should be moved outside of the </table>
Solution 2:
cssmenu/header.cfm would need to finish the current table row and start an new one. This is not recommended. It is not modular at all.
</tr>
<tr>
<td colspan="3">
... Content goes here ...
</td>
</tr>
You are missing a </tr> before the <cfinclude>. Also it seems like an odd place to include a header, rather add another table row and td and include the header inside of the <td> not in between the table code as this is causing it to break.

Can anyone tell me why my generated HTML is not working with this XSLT

I have the below XSLT, but when it runs, it creates the below HTML. The problem is with the two tables. The LinesFOC elements appear within the first table instead of the second table as per the XSLT.
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Order Received</h2>
<table border="1">
<tr>
<th>Outlet</th>
<td><xsl:value-of select="Order/Outlet/Name"/></td>
</tr>
<tr>
<th>House Name / Number</th>
<td><xsl:value-of select="Order/Outlet/HouseNameNumber"/></td>
</tr>
<tr>
<th>Street Name</th>
<td><xsl:value-of select="Order/Outlet/Street1"/></td>
</tr>
<tr>
<th></th>
<td><xsl:value-of select="Order/Outlet/Street2"/></td>
</tr>
<tr>
<th></th>
<td><xsl:value-of select="Order/Outlet/Street3"/></td>
</tr>
<tr>
<th>Suburb</th>
<td><xsl:value-of select="Order/Outlet/Suburb"/></td>
</tr>
<tr>
<th>Town</th>
<td><xsl:value-of select="Order/Outlet/Town"/></td>
</tr>
<tr>
<th>County</th>
<td><xsl:value-of select="Order/Outlet/County"/></td>
</tr>
<tr>
<th>Postcode</th>
<td><xsl:value-of select="Order/Outlet/Postcode"/></td>
</tr>
<tr>
<th>Telephone Number</th>
<td><xsl:value-of select="Order/Outlet/TelephoneNumber"/></td>
</tr>
<tr>
<th>Contact Name</th>
<td><xsl:value-of select="Order/Outlet/ContactName"/></td>
</tr>
<tr>
<th>UWG Account Number</th>
<td><xsl:value-of select="Order/Outlet/UWGAccountNumber"/></td>
</tr>
<tr>
<th>Cash or Credit</th>
<td><xsl:value-of select="Order/Outlet/CashOrCredit"/></td>
</tr>
<tr>
<th>Order Date</th>
<td><xsl:value-of select="Order/Date"/></td>
</tr>
<tr bgcolor="#9acd32">
<th>Qty</th>
<th>Description</th>
</tr>
<xsl:for-each select="Order/Lines/LineItem">
<tr>
<td><xsl:value-of select="Qty"/></td>
<td><xsl:value-of select="Description"/></td>
</tr>
</xsl:for-each>
</table>
<table border="1">
<tr bgcolor="#9acd32">
<td></td>
<td>Free of Charge Items</td>
</tr>
<xsl:for-each select="Order/LinesFOC/LineItem">
<tr>
<td><xsl:value-of select="Qty"/></td>
<td><xsl:value-of select="Description"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The generated HTML is
<table class="MsoNormalTable" border="1" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Outlet </b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">Test Outlet 4</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>House Name / Number
</b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">Test House</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Street Name </b>
</p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">Test Street</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Suburb </b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">Testtown</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Town </b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">Testtown</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>County </b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">Cardiganshire</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Postcode </b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">GU21 </p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Telephone Number
</b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Contact Name </b>
</p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>UWG Account Number
</b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">55555555555</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Cash or Credit </b>
</p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Order Date </b></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">05/06/2013 00:00:00</p>
</td>
</tr>
<tr>
<td style="background:yellowgreen; padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Qty</b></p>
</td>
<td style="background:yellowgreen; padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><b>Description</b></p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">3</p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"> Chocolate 1L (110717)</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">3</p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"> Strawberry 1L (110645)</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">3</p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"> Banana 1L (110656)</p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">3</p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"> Strawberry 1L (110645) </p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style=""> </span></p>
<table class="MsoNormalTable" border="1" cellpadding="0">
<tbody>
<tr>
<td style="background:yellowgreen; padding:.75pt .75pt .75pt .75pt"></td>
<td style="background:yellowgreen; padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">Free of Charge Items </p>
</td>
</tr>
</tbody>
</table>
the last item of the first table, being:
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal">3</p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"> Strawberry 1L (110645) </p>
</td>
</tr>
should be on the second table, but for some reason, appears in the first table.
Impossible to say for sure what's going on, in the current state of the question. The two most likely causes are these.
(1) The input (which you do not show) has
<LineItem>
<Qty>3</Qty>
<Description> Strawberry 1L (110645) </Description>
</LineItem>
appearing as a child of Lines, not as a child of LinesFOC.
(2) The stylesheet which actually produced the output (which, as hr_117 and Borodin have already pointed out, you do not show) has <xsl:for-each select="Order/Lines/LineItem"> (or the equivalent) where the stylesheet you show has <xsl:for-each select="Order/LinesFOC/LineItem">.
In other words, you appear to be looking at the wrong files.