xsl - string translate in my code - Help required - string

I have an xsl code where I need to implement replaceAll functionality as we do in Java. I tried
trasnlate function but it was not working. I am not sure where and how to use the function in the below code and you please help on this.
<xsl:template match="warning">
<xsl:param name="drugsSub" select="'false'"/>
<tr>
<td class="dataRowBorderBottom rowColor" style="width: 35%; padding-right: 5px; font-size:.85em;">
**<xsl:apply-templates select="translate(warningId,'/','/ ')">** This is not working. I want translate function to work both warningId. A value comes for this variable from some other file.
<xsl:with-param name="drugsSub" select="$drugsSub"/>
</xsl:apply-templates>
</td>
<td class="dataRowBorderBottom rowColor leftPadding" style="width: auto; padding-bottom: 15px; font-size:.85em;">
<xsl:apply-templates select="severity"/>
</td>
<td class="dataRowBorderBottom rowColor leftPadding" style="width: 13%;font-size:.85em;">
<xsl:apply-templates select="documentationRating"/>
</td>
<td class="dataRowBorderBottom rowColor leftPadding" style="width: 35%; padding-top: 3px; font-size:.85em;">
<xsl:value-of select="warningText"/>
</td>
</tr>
</xsl:template>

I can tell you why the code doesn't work: translate() produces a string, and you can't apply-templates to a string (only to a node-set).
But I can't tell you how to fix it, because I have no idea what you are trying to achieve.

Related

TinyMCE paste from excel

I have a problem with TinyMCE editor which I cannot resolve.
If I copy a table from Excel and paste it into the editor it loses the formatting. I have set up extended_valid_elements as follows...
extended_valid_elements:"a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],table[style|class|border=2|width|cellspacing|cellpadding|bgcolor],colgroup,col[style|width],tbody,tr[style|class],td[style|class|colspan|rowspan|width|height|background|span|padding],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style|font-family|color]"
The HTML that is saved into the MySQL field is as follows
From Excel ...
<table style="border-collapse: collapse; width: 242pt;" border="2" width="322">
<tbody>
<tr style="height: 14.25pt;">
<td style="height: 14.25pt; width: 105pt;" width="140">Test</td>
<td style="width: 104pt;" width="138"></td>
<td style="width: 33pt;" width="44"> </td>
</tr>
</tbody>
</table>
From Word ...
<table style="width: 242.0pt; border-collapse: collapse;" border="2" width="0">
<tbody>
<tr style="height: 14.25pt;">
<td style="width: 105.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="140">
<p style="margin-bottom: .0001pt; line-height: normal;"><span style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: black;">Test</span></p>
</td>
<td style="width: 104.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="139"></td>
<td style="width: 33.0pt; background: #92D050; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="44">
<p style="margin-bottom: .0001pt; line-height: normal;"><span style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: black;"> </span></p>
</td>
</tr>
</tbody>
</table>
How can I make this work from excel without having to go through word first?
It would appear I have to use power paste which is a paid-for option ... I have a call setup with their sales team to see how much it will cost! Fingers crossed.

HTML table scraping - table object returned as 1 big cell instead of separate elements

I've been working on a webpage scraping program from within excel VBA (with lots of help from this forum).
I've gotten stuck at a table which shows a single row, which I need to automate clicking. I used the same method for a similar table earlier in the process and that worked fine:
setting the HTML table to IEtable object
using ietable.rows(1).click
This table however, returns as 1 cell containing the values of all the separate elements I see on the webpage and the .click function doesn't work.
This is the HTML code for the table I am trying to access:
<table id="tblPatientList" class="tblTabBody" style="height: 143px; width: 653px;" cellspacing="2" cellpadding="0">
<tbody>
<tr style="height: 100%; width: 100%;">
<td style="width: 649px; height: 100%;">
<div id="divPatientList" style="overflow: auto; width: 100%; height: 100%; background-color: white;">
<table id="dgrPatients" class="tblpat" style="border-width: 0px; width: 100%; border-collapse: collapse;" border="0" rules="all" cellspacing="0" cellpadding="1">
<tbody>
<tr class="headerBlue">
<td style="width: 5%;"> </td>
<td style="width: 15%;">Hosp No.</td>
<td style="width: 15%;">Surname</td>
<td style="width: 15%;">Forename</td>
<td style="width: 10%;">DOB</td>
<td style="width: 2%;">Sex</td>
<td style="width: 10%;">NHS Number</td>
<td style="width: 25%;">Address</td>
<td class="screenOnlyOutput" style="width: 5%;" align="center">List</td>
</tr>
<tr class="even" style="color: red;">
<td align="center"> </td>
<td><strong>12345678</strong></td>
<td>ANONYMOUS FIRST NAME</td>
<td>ANONYMOUS LAST NAME</td>
<td>dd/mm/yyyy</td>
<td align="center">M</td>
<td>123 456 7890 <img style="cursor: hand; vertical-align: middle; border: 0px;" title="Number present and verified" src="/icedesktop/dotnet/icedesktop/images/tick.gif" /></td>
<td>ANONYMOUS ADDRESS</td>
<td class="screenOnlyOutput" align="center"><input id="dgrPatients_ctl02_chkAddOrRemove" style="border: 0px; height: 12px;" name="dgrPatients$ctl02$chkAddOrRemove" type="checkbox" /></td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
This table always only returns 2 rows - a header and 1 data row. I try to click it with:
Set ieTbl = ieDoc.Document.frames(0).Document.all.tblPatientList
If Not ieTbl Is Nothing Then
ieTbl.Rows(1).Click
Set ieTbl = Nothing
End If
When I examine the ietable object in the immediate window, it only has 1 row and 1 column, containing all the separate cells on the html page in 1 cell in the ietbl object.
Why is it doing this?

NetSuite: FreeMarker List Getting Pushed Down

I can't figure out why this list is getting pushed down? The list items start at the 4th row. I was hoping the <#compress> directive would truncate any white space but had no affect on the output.
blank line/white space
blank line/white space
blank line/white space
blank line/white space
Ice Cream $50.00
Vanilla
--next page--
Ice Cream $50.00
Chocolate
<hr
style="width: 100%; color: #d3d3d3; background-color: #d3d3d3; height: 1px;" />
<!-- start items -->
<#list record.item as item>
<table style="margin-top: 10px; width: 100%;">
<#if item.custcol_comments?contains("cream")>
<#compress>
<tr>
<td colspan="12" style="text-align: center;"><span
style="font-weight: bold; line-height: 10%; color: #333333;">${item.item}</span><br />${item.description}</td>
<td colspan="4" style="text-align: center;"> </td>
<td colspan="4" style="text-align: center;">${item.amount}</td>
</tr>
</#compress>
</#if>
</table>
</#list>
<!-- end items -->
<hr
You need to swap the order of the table and <#list> tags. What you are doing right now is creating a separate table for every line item, irrespective of whether or not it matches the condition.
<table style="margin-top: 10px; width: 100%;">
<#list record.item as item>
<#if item.custcol_comments?contains("cream")>
<tr>
<td colspan="12" style="text-align: center;"><span style="font-weight: bold; line-height: 10%; color: #333333;">${item.item}</span><br />${item.description}</td>
<td colspan="4" style="text-align: center;"> </td>
<td colspan="4" style="text-align: center;">${item.amount}</td>
</tr>
</#if>
</table>
</#list>
<#compress> will remove whitespace but not empty tables, but in any case the BFO renderer will automatically remove extra whitespace so it's not typically needed in NetSuite templates.

Gmail override font color

My code :
<tr>
<td align="center" style="font-size:9pt; font-weight : bold;font-family:Arial; color:black;">
SELLE ZETA CONFORT GEL
</td>
</tr>
When i try on different mail client, the text is black, but on gmail (explorer,chrome and firefox) this text is blue.
How can i fix this?
If you want to look an exemple:
http://issl.fr/test/test_validator.html
Take all the code html and copy it there :
https://litmus.com/email-testing
You will be able to have a preview on every client. Look the gmail one.
Because your text is sitting in an <a> tag (your <a> is wrapping the table with your text in it). That's why your text is turning to blue. Apply a color to your <a> and that should solve it... John is right to use a proper hex code for the color.
As well, Gmail likes to change color:#000000 on links to default blue even if you state that it should be color:#000000. Use color:#000001. That will solve it.
With gmail you need to be redundant on your colors.
Not only would you have to declare a color with in the but you should also wrap it in a span with the color as well.
This is one of your items below with the correct code:
<Track Link>
<a style="text-decoration : none; color:#000000;" href="http://www.decathlon.be/selle-zeta-confort-gel-id_8052361.html">
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody>
<tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody>
<tr height="3"></tr><tr style="height : 32px !important; min-height : 32px !important; max-height : 32px !important; ">
<td width="6"></td>
<td align="left">
<div style="height :32px !important; min-height : 32px !important; max-height : 32px !important; "></div>
</td>
<td width="58"></td>
<td align="right">
<div style="height :32px !important; min-height : 32px !important; max-height : 32px !important; "><img border="0" style="display:block;" width="64" height="32" alt=" " src="http://decathlonbe.net/images/Marques/geonaute.png"></div>
</td>
<td width="6"></td>
</tr><tr height="1"></tr>
</tbody></table>
</td></tr>
<tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody>
<tr>
<td align="center">
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="5"></td>
<td><img width="188" border="0" alt="" src="http://www.decathlon.be/media/805/8052361/classic_400PX_asset_71685950.jpg" style="display : block;"></td>
<td width="5"></td>
</table>
</td>
</tr>
<tr>
<td align="center" style="font-size:9pt; font-weight : bold;font-family:Arial; color:black;"><span style="color:#000000;">SELLE ZETA CONFORT GEL</span></td>
</tr>
<tr>
<td align="center" style="font-size:9pt; font-family:Arial; color:#6f6f6f;"></td>
</tr>
</tbody></table>
</td></tr><tr><td>
<div class="price" style="font-family : Arial; font-size : 22pt; color : black; text-align : center;"><div class="nopromo" style="font-weight:bold;font-family : Arial; font-size : 19pt; color : black; text-align : center;">29<sup style="font-size:12pt;">€95</sup></div></div>
</td></tr><tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody>
<tr>
<td width="15"></td>
<td valign="middle" align="center">
<Track Link><a style="text-decoration : none; font-family : Arial; font-weight : bold; font-size : 11pt; color : white;" href="http://www.decathlon.be/selle-zeta-confort-gel-id_8052361.html"><table align="center" cellspacing="0" cellpadding="0" border="0" style="background : #efefef;" >
<tr height="32" style="background-color : #FF7100;">
<td width="5" ><span style="color: #FF7100;">i<span></td>
<td style = "max-width: 144px;"> <div style="color : white;text-align:center; font-size : 10pt;font-family:Arial;font-weight: bold; ">sefsefse </div></td>
<td style="padding-left : 5px;">
<span style="color : white; font-weight : bold; font-size : 12pt;"> > </span>
</td>
<td width="5"><span style="color: #FF7100;">i</span></td>
</tr>
</table>
</a></Track Link>
</td>
<td width="15"></td>
</tr>
<tr height="8"></tr>
</tbody></table>
</td></tr>
</tbody></table>
</a>
In email you must use the 6-digit hex codes for maximum compatibility across email clients. Use CSS for text ie: color:#000000;, and html's bgcolor="#FFFFFF" for backgrounds
Darryl Vos's Answer is correct.
I style links with color:#00001 to achieve a black link in emails all the time.
I work in an agency and no one has ever complained it does not look black.

I'm having issues pulling the link to the site from a link list in Sharepoint using the Enhanced Custom Query W/P

I've created a custom style in my ItemStyle.xsl for displaying a list of links from a links list in SharePoint 2007. The only problem I'm getting is I can pull the link to the item in the list, but I can pull the URL stored within the item in the list. Here is my style:
<xsl:template name="LinkListStyled" match="*" mode="itemstyle">
<xsl:param name="CurPos" />
<xsl:param name="LastRow" />
<xsl:variable name="tableStart">
<xsl:if test="$CurPos = 1">
<![CDATA[
<table style="border:0px ; border-collapse:collapse; ">
<tr>
<td align="left" width="70px">
<IMG style="BORDER-BOTTOM: 0px solid; BORDER-LEFT: 0px solid; BORDER-TOP: 0px solid; BORDER-RIGHT: 0px solid" border=0 src="http://intranet.test.co.uk/images/sharepoint_sites/practiceareas/knowhowgreen2.png">
</td>
<td align="left">
<table style="padding:5px">
]]>
</xsl:if>
</xsl:variable>
<xsl:variable name="tableEnd">
<xsl:if test="$CurPos = $LastRow">
<![CDATA[
</table>
</td>
</tr>
</table>]]>
</xsl:if>
</xsl:variable>
<xsl:value-of select="$tableStart" disable-output-escaping="yes"/>
<xsl:if test="($CurPos mod 2) = 1">
<xsl:text disable-output-escaping="yes">
<![CDATA[<tr>
<td width="2px">
<IMG src="http://intranet.test.co.uk/images/sharepoint/green_square_header.gif" />
</td>
<td width="150px">
<a href="
]]>
</xsl:text>
<xsl:value-of select="#FileRef"/>
<xsl:text disable-output-escaping="yes">
<![CDATA["> ]]>
</xsl:text>
<xsl:value-of select="#Title"></xsl:value-of>
<xsl:text disable-output-escaping="yes">
<![CDATA[</a></td>]]>
</xsl:text>
</xsl:if>
<xsl:if test="($CurPos mod 2) = 0">
<xsl:text disable-output-escaping="yes">
<![CDATA[
<td width="2px">
<IMG src="http://intranet.test.co.uk/images/sharepoint/green_square_header.gif" />
</td>
<td width="150px">
]]>
</xsl:text>
<xsl:value-of select="#Title"></xsl:value-of><br />
<xsl:text disable-output-escaping="yes">
<![CDATA[</td>
</tr>]]>
</xsl:text>
</xsl:if>
<xsl:value-of select="$tableEnd" disable-output-escaping="yes" />
</xsl:template>
I have tried using the same methods as in the LinkList style:
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="#URL"/>
<xsl:with-param name="UrlColumnName" select="'URL'"/>
</xsl:call-template>
</xsl:variable>
But the moment I add this into my style it breaks the view. Oddly, if I put a call to the OuterTemplate outside my style and then reference the values in my style it doesn't fall over and I can pull through the values, however this doesn't work for URL (I'm guessing this is because it needs to pull through a title to retrieve the URL). I've tried a few different things but to no avail.
I needed to add the 'URL,text' into the Custom Field View in the web part.

Resources