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
LVL 5
magentoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zc2Commented:
So, do you need an XSLT which converts the data XML to HTML?
zc2Commented:
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

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

Thanks
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

magentoAuthor Commented:
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,
zc2Commented:
Ok, have redesigned it a little:

<?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" cellspacing="0">
  	<tr style="background-color: yellow;"><td>NAME</td><td>VALUE</td></tr>
  	<xsl:apply-templates select="f:COL[1]/f:DATA"/>
  </table>
</xsl:template>

<xsl:template match="f:DATA">
  <xsl:variable name="p" select="position()"/>
  <tr>
	<td style="font-weight: bold;">
		<xsl:value-of select="."/>
	</td>
	<xsl:apply-templates select="../../f:COL[2]/f:DATA[$p]" mode="right-col"/>
  </tr>
</xsl:template>

<xsl:template match="f:DATA" mode="right-col">
	<td>
		<xsl:value-of select="."/>
		<xsl:if test="string-length(normalize-space(.)) = 0">&#xA0;</xsl:if>
	</td>
</xsl:template>	
	
</xsl:stylesheet>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
magentoAuthor Commented:
This works great , thank you.
zc2Commented:
You're welcome
magentoAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.