Avatar of magento
magento
 asked on

Filemaker xsl file

Hi,

I am having a xml , which is a simple table . I just need to make the first column bold and header in yellow color .

Please help me provide a xsl file for it.

Thanks
test.xml
XMLFileMaker ProWeb Languages and Standards

Avatar of undefined
Last Comment
magento

8/22/2022 - Mon
zc2

So, do you need an XSLT which converts the data XML to HTML?
zc2

Since I did not get an answer to my question, I assumed you need an HTML output.
I made a simple XSLT which creates an HTML table from your input XML:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:f="http://www.filemaker.com/fmpxmlresult">
<xsl:output method="html" encoding="iso-8859-1"/>

<xsl:template match="/">
  	<xsl:apply-templates select="f:FMPXMLRESULT/f:RESULTSET/f:ROW"/>
</xsl:template>

<xsl:template match="f:ROW">
  <table border="1">
  	<xsl:apply-templates select="f:COL"/>
  </table>
</xsl:template>
	
<xsl:template match="f:COL">
  <tr>
	<xsl:if test="position() = 1">
		<xsl:attribute name="style">background-color: yellow;</xsl:attribute>
	</xsl:if>
    <xsl:apply-templates select="f:DATA"/>
  </tr>
</xsl:template>	
	
<xsl:template match="f:DATA">
	<td>
		<xsl:if test="position() = 1">
			<xsl:attribute name="style">font-weight: bold;</xsl:attribute>
  		</xsl:if>
		<xsl:value-of select="."/>
		<xsl:if test="string-length(normalize-space(.)) = 0">&#xA0;</xsl:if>
	</td>
</xsl:template>	
	
</xsl:stylesheet>

Open in new window

magento

ASKER
Hi,
yes this is what i am looking for , i will test it and let you know.

Thanks
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
magento

ASKER
Hi ,

I am getting the output in different manner.
I want them to show like  below.

NAME              VALUE
Retail Price       100
Item Class         25486

But i am getting the html table in horizontal way. Please find the result i have got.

<table xmlns:f="http://www.filemaker.com/fmpxmlresult" border="1">
<tr style="background-color: yellow;">
<td style="font-weight: bold;">Retail Price</td><td>Item Class</td><td>Item Group</td><td>Consumer Description</td><td>Color</td><td>Item Code</td><td>Catalog Vendor Name</td><td>Item Status</td><td>Wildcat Eligible</td><td>Item Description</td><td>Primary Vendor</td><td>InventoryTyp</td><td>ProductPageNumber</td><td>Vendor Group</td>
</tr>
<tr>
<td style="font-weight: bold;">234.99</td><td>13034</td><td>13</td><td>BlackGorge Expandable Convertible Pack System With Hydration Pocket Mossy Oak Break Up Camouflage</td><td>Mossy Oak Break-Up</td><td>73CP00M1</td><td>BLACKHAWK!</td><td>OPEN</td><td>Y</td><td>BHP BLACKGORGE EXPAND MOBU</td><td>58895</td><td>MDS</td><td>&nbsp;</td><td>BHP</td>
</tr>
</table>

Open in new window


Thanks,
ASKER CERTIFIED SOLUTION
zc2

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
magento

ASKER
This works great , thank you.
zc2

You're welcome
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
magento

ASKER