Hello I know there are some modules in perl to extract tags from html source files but I need to extract this quicly: Name CA. THAKRAR UTSAV SUBHASH.
http://regex101.com/r/dZ8mY1/1
<b>(Name)<\/b>.*?<b>(?!<\/font>|:)(.*?)<\/b>
Try this . See demo.
http://regex101.com/r/dZ8mY1/3
Always use an HTML Parser for parsing html.
The following uses Mojo::DOM to find the value for which you're searching. For a helpful 8 minute introductory video to this module, check out Mojocast Episode 5.
use strict;
use warnings;
use Mojo::DOM;
my $dom = Mojo::DOM->new(do {local $/; <DATA>});
for my $td($dom->find('td')->each) {
next if $td->all_text ne 'Name';
my $next = $td;
while ($next = $next->next_sibling) {
last if $next->node eq 'tag' and $next->all_text !~ /^[[:punct:]\s]*$/;
}
print $next->all_text, "\n";
}
__DATA__
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Member Card The Institute of Chartered Accountants of India</title>
<script language="javascript" type="text/javascript">
<!-- var win=null; function NewWindow(mypage,myname,w,h,scroll,pos){ if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;} else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20} settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings);} // -->
</script>
<script language="JavaScript1.1">
<!-- Original: Vivek Gupta --> <!-- Begin function right(e) { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false; else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) { alert("Sorry, you do not have permission to right click."); return false; } return true; } document.onmousedown=right; document.onmouseup=right; if (document.layers) window.captureEvents(Event.MOUSEDOWN); if (document.layers) window.captureEvents(Event.MOUSEUP); window.onmousedown=right; window.onmouseup=right; // End -->
</script>
</head>
<body bgcolor="#ECFFFF">
<p align="center"><u><i><b><font size="5">Members Details as on
Date</font></b></i></u></p>
<hr>
<div align="right">
<table border="0" width="100%">
<tr>
<td width="13%" bgcolor="#CCCCFF"><font size="2"><b>Membership No.</b></font></td>
<td width="2%" bgcolor="#99CCFF"><font size="2"><b>:</b></font></td>
<td width="25%" bgcolor="#99CCFF"><font size="2"><b>140337, </b></font> <b><font color="#FF0000" size="3">ACTIVE</font></b></td>
<td width="8%" bgcolor="#CCCCFF"><font size="2"><b>Sex</b></font></td>
<td width="1%" bgcolor="#99CCFF"><font size="2"><b>:</b></font></td>
<td width="18%" bgcolor="#99CCFF"><font size="2"><b>M</b></font></td>
<td width="13%" bgcolor="#CCCCFF"><font size="2"><b>Date of Birth</b></font></td>
<td width="1%" bgcolor="#99CCFF"><font size="2"><b>:</b></font></td>
<td width="38%" bgcolor="#99CCFF"><font size="2"><b>30/12/1986</b></font></td>
</tr>
<tr>
<td width="13%" bgcolor="#CCCCFF"><font size="2"><b>Name</b></font></td>
<td width="2%" bgcolor="#99CCFF"><font size="2"><b>:</b></font></td>
<td width="25%" bgcolor="#99CCFF"><font size="2"><b>CA. THAKRARUTSAV SUBHASH</b></font></td>
<td width="8%" bgcolor="#CCCCFF"><font size="2"><b>Blood Grp</b></font></td>
<td width="1%" bgcolor="#99CCFF"><font size="2"><b>:</b></font></td>
<td width="18%" bgcolor="#99CCFF"><font size="2"><b>B (-)</b></font></td>
<td width="13%" bgcolor="#CCCCFF"><font size="2"><b>Enrolment Dt.</b></font></td>
<td width="1%" bgcolor="#99CCFF"><font size="2"><b>:</b></font></td>
<td width="38%" bgcolor="#99CCFF"><font size="2"><b>29/07/2011</b></font></td>
</tr>
<tr>
<td width="13%" bgcolor="#CCCCFF"><font size="2"><b>Asso. / Fellow</b></font></td>
<td width="2%" bgcolor="#99CCFF">:</td>
<td width="25%" bgcolor="#99CCFF"><font size="2"><b>ACA</b></font></td>
<td width="8%" bgcolor="#CCCCFF"><font size="2"><b>Nationality</b></font></td>
<td width="1%" bgcolor="#99CCFF"></td>
<td width="18%" bgcolor="#99CCFF"><font size="2"><b>IND</b></font></td>
<td width="13%" bgcolor="#CCCCFF"><font size="2"><b>FellowDate</b></font></td>
<td width="1%" bgcolor="#99CCFF"><font size="2"><b>:</b></font></td>
<td width="38%" bgcolor="#99CCFF"><font size="2"><b> </b></font></td>
</tr>
<tr>
<td width="13%" bgcolor="#CCCCFF"><font size="2"><b>Father's Name</b></font></td>
<td width="2%" bgcolor="#99CCFF"><font size="2"><b>:</b></font></td>
<td width="25%" bgcolor="#99CCFF"><font size="2"><b>SUBHASH THAKRAR</b></font></td>
<td width="8%" bgcolor="#CCCCFF"></td>
<td width="1%" bgcolor="#99CCFF"></td>
<td width="18%" bgcolor="#99CCFF"></td>
<td width="13%" bgcolor="#CCCCFF"><b><font size="2">COP Status</font></b></td>
<td width="1%" bgcolor="#99CCFF"><b>:</b></td>
<td width="27%" bgcolor="#99CCFF"><font size="2"><b>FULLTIME</b></font></td>
</tr>
</table>
</div>
<hr>
<div align="right">
<table border="0" width="100%">
<tr>
<td width="50%" colspan="2" bgcolor="#CCCCFF"><u><font size="2"><b>Professional Address Details</b></font></u></td>
<td width="50%" colspan="2" bgcolor="#CCCCFF"><u><font size="2"><b>Residential Address Details</b></font></u></td>
</tr>
<tr>
<td width="50%" colspan="2"></td>
<td width="50%" colspan="2"></td>
</tr>
<tr>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b>OPP PUNJAB NATIONAL BANK</b></font></td>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b>M/S CHATRABHUJ SAVJI & CO</b></font></td>
</tr>
<tr>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b>SUTARWADA</b></font></td>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b>SUTARWADA</b></font></td>
</tr>
<tr>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b> </b></font></td>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b> </b></font></td>
</tr>
<tr>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b> </b></font></td>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b> </b></font></td>
</tr>
<tr>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b>PORBANDAR - 360575</b></font></td>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b>PORBANDAR - 360575</b></font></td>
</tr>
<tr>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b>INDIA</b></font></td>
<td width="50%" colspan="2" bgcolor="#99CCFF"><font size="2"><b>INDIA</b></font></td>
</tr>
<tr>
<td width="14%" bgcolor="#CCCCFF"><font size="2"><b>Tel. No.</b></font></td>
<td width="36%" bgcolor="#99CCFF"><font size="2"><b>0286-2243863</b></font></td>
<td width="14%" bgcolor="#CCCCFF"><font size="2"><b>Tel. No.</b></font></td>
<td width="34%" bgcolor="#99CCFF"><font size="2"><b>0286 2245641</b></font></td>
</tr>
<tr>
<td width="14%" bgcolor="#CCCCFF"><font size="2"><b>Fax. No.</b></font></td>
<td width="36%" bgcolor="#99CCFF"><font size="2"><b> </b></font></td>
<td width="14%" bgcolor="#CCCCFF"><font size="2"><b>Fax. No.</b></font></td>
<td width="34%" bgcolor="#99CCFF"><font size="2"><b> </b></font></td>
</tr>
<tr>
<td width="14%" bgcolor="#CCCCFF"><font size="2"><b>Mob. No.</b></font></td>
<td width="36%" bgcolor="#99CCFF"><font size="2"><b>09409059418</b></font></td>
<td width="14%" bgcolor="#CCCCFF"><font size="2"><b>Mob. No.</b></font></td>
<td width="34%" bgcolor="#99CCFF"><font size="2"><b>09409059418</b></font></td>
</tr>
<tr>
<td width="14%" bgcolor="#CCCCFF"><font size="2"><b>E-mail.</b></font></td>
<td width="36%" bgcolor="#99CCFF"><font size="2"><b>usthakrar#gmail.com</b></font></td>
<td width="14%" bgcolor="#CCCCFF"><font size="2"><b>E-mail.</b></font></td>
<td width="34%" bgcolor="#99CCFF"><font size="2"><b>usthakrar#gmail.com</b></font></td>
</tr>
</table>
</div>
<hr>
<div align="right">
<table border="0" width="100%">
<tr>
<td width="29%"><b><font color="#0000FF">Member Employment Details</font></b></td>
<td width="27%"><b><font color="#0000FF">Member Firm Association Details</font></b></td>
<td width="44%"><b><font color="#0000FF">Article / Audit (List of Student undergoing Training with details)</font></b></td>
</tr>
<tr>
<td width="29%">.</td>
<td width="27%"></td>
<td width="44%">.</td>
</tr>
<tr>
<td width="100%" colspan="3" align="center"><b><font color="#0000FF">Search Firm Registered / Approved with ICAI as on Date</font></b></td>
</tr>
</table>
</div>
<p> </p>
<hr>
<p> </p>
</body>
</html>
Outputs:
CA. THAKRARUTSAV SUBHASH
Related
I would like to draw a graph like this -
I have Graphviz code like this -
digraph G {
"test" [
label = <<table border="0" cellspacing="0">
<tr>
<td port="f0" border="1" bgcolor="darkorange">TEST</td>
<td port="f1" border="1" bgcolor="darkorange"></td>
</tr>
<tr>
<td port="f2" border="1" bgcolor="cyan">A</td>
<td>
<table border="0" cellspacing="0">
<tr><td port="f3" border="1" bgcolor="azure">A1</td></tr>
<tr><td port="f4" border="1" bgcolor="azure">A2</td></tr>
<tr><td port="f5" border="1" bgcolor="azure">A3</td></tr>
</table>
</td>
</tr>
<tr>
<td port="f5" border="1" bgcolor="gray">Else</td>
<td port="f6" border="1" bgcolor="gray"></td>
</tr>
</table>>
shape = "none"
];
}
But it gives the graph like this
Would you please suggest how can we tweak the code to achieve the objective - merging f0, f1 on top and f5,f6 at bottom?
You can use HTML <td>s with colspan and rowspan attributes in GraphViz. These allow one cell to span multiple columns and/or rows inside a table.
This also simplifies your digraph, as only one table is needed.
digraph G {
"test" [
label = <<table border="0" cellspacing="0">
<tr>
<td colspan="2" port="f0" border="1" bgcolor="darkorange">TEST</td>
</tr>
<tr>
<td rowspan="3" port="f5" border="1" bgcolor="blue">A</td>
<td port="f6" border="1" bgcolor="white">A1</td>
</tr>
<tr>
<td port="f6" border="1" bgcolor="white">A2</td>
</tr>
<tr>
<td port="f6" border="1" bgcolor="white">A3</td>
</tr>
<tr>
<td colspan="2" port="f0" border="1" bgcolor="grey">Else</td>
</tr>
</table>>
shape = "none"
];
}
This gives you the following basic output, which you can then customize for spacing, line colors, etc:
This one also works. what's is the difference?
digraph G {
"test" [
label = <<table border="0" cellspacing="0">
<tr><td colspan="2" port="f0" border="1" bgcolor="darkorange">TEST</td> </tr>
<tr><td rowspan="4" port="f5" border="1" bgcolor="blue">A</td></tr>
<tr><td port="f6" border="1" bgcolor="white">A1</td></tr>
<tr><td port="f6" border="1" bgcolor="white">A2</td></tr>
<tr><td port="f6" border="1" bgcolor="white">A3</td></tr>
<tr><td colspan="2" port="f0" border="1" bgcolor="grey">Else</td></tr>
</table>>
shape = "none"
];
}
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
I have a table like following:
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg .tg-baqh{text-align:center;vertical-align:top}
</style>
<table class="tg">
<tr>
<th class="tg-baqh">Store Name</th>
<th class="tg-baqh">Week Number</th>
<th class="tg-baqh">Sales</th>
<th class="tg-baqh">Sales-LY</th>
</tr>
<tr>
<td class="tg-baqh">Store A</td>
<td class="tg-baqh">1</td>
<td class="tg-baqh">20</td>
<td class="tg-baqh">15</td>
</tr>
<tr>
<td class="tg-baqh">Store A</td>
<td class="tg-baqh">2</td>
<td class="tg-baqh">25</td>
<td class="tg-baqh">20</td>
</tr>
<tr>
<td class="tg-baqh">Store A</td>
<td class="tg-baqh">3</td>
<td class="tg-baqh">30</td>
<td class="tg-baqh">25</td>
</tr>
<tr>
<td class="tg-baqh">Store B</td>
<td class="tg-baqh">1</td>
<td class="tg-baqh">15</td>
<td class="tg-baqh">10</td>
</tr>
<tr>
<td class="tg-baqh">Store B</td>
<td class="tg-baqh">2</td>
<td class="tg-baqh">15</td>
<td class="tg-baqh">15</td>
</tr>
<tr>
<td class="tg-baqh">Store B</td>
<td class="tg-baqh">3</td>
<td class="tg-baqh">20</td>
<td class="tg-baqh">15</td>
</tr>
<tr>
<td class="tg-baqh">Store C</td>
<td class="tg-baqh">1</td>
<td class="tg-baqh">30</td>
<td class="tg-baqh">25</td>
</tr>
<tr>
<td class="tg-baqh">Store C</td>
<td class="tg-baqh">2</td>
<td class="tg-baqh">0</td>
<td class="tg-baqh">20</td>
</tr>
<tr>
<td class="tg-baqh">Store C</td>
<td class="tg-baqh">3</td>
<td class="tg-baqh">25</td>
<td class="tg-baqh">20</td>
</tr>
</table>
I would like to return (lets' say) a pivot table with
Salex IDX = SUM(Sales)/SUM(Sales-LY) as a measure, ignoring the data points for "Week 2 for Store C".
So it's not a filter on just Week Number or Store, but its a filter on specific row(s) identified by multiple parameters.
Essentially, i would like to get 'like for like' results, excluding any weeks where Sales or Sales-LY columns are zero(or null)
Any ideas?
I would add a calculated column to concatenate Store and Week, something like this:
=[Store Name]&", Week: "&[Week Number]
Then you can use a filter or slicer to exclude the Store & Week combination you want.
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.
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.