Subject: Re: [xsl] accessing attributes From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 09 Sep 2008 15:08:19 -0400 |
<xsl:value-of select="fmp:METADATA/fmp:FIELD[3]@NAME"/>
Good luck, Wendell
Hi everyone, I'm new to this so please forgive any missing information etc. I'm trying to write an xslt style sheet to transform the xml output from a filemaker database and I'm running into a few issues. My processor allows XSL v1.0 with library libxslt (running using PHP so looks like this is all I can get).
The filemaker output gives the field names in a metadata node, with the data coming later:
<?xml version="1.0" encoding="UTF-8" ?> <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult"> <METADATA> <FIELD NAME="F1"/> <FIELD NAME="F2"/> </METADATA> <DATA> <ROW> <COL><DATA>V1</DATA></COL> <COL><DATA>V2</DATA></COL> </ROW> <ROW> <COL><DATA>V3</DATA></COL> <COL><DATA>V4</DATA></COL> </ROW> </DATA>
Basically I want to be able to relate each column value to it's name in the METADATA. However I'm not that far yet. To start with can someone please tell me how I should be writing this xsl:value-of element?
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fmp="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fmp">
<xsl:template match="fmp:FMPXMLRESULT"> <xsl:value-of select="fmp:METADATA/fmp:FIELD[3]@NAME"/> </xsl:template> </xsl:stylesheet>
Many thanks tom
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] accessing attributes, Tom Wright | Thread | Re: [xsl] accessing attributes, Tom Wright |
Re: [xsl] accessing attributes, Tom Wright | Date | Re: [xsl] xslt sort dilemna, Wendell Piez |
Month |