[xsl] [XPath] structure similar to CSV with column names in first row

Subject: [xsl] [XPath] structure similar to CSV with column names in first row
From: Beverly Voth <bvoth@xxxxxxxxxxx>
Date: Wed, 03 Dec 2003 10:19:03 -0500
GIVEN
=====
1) Sometimes the XML is:
'<people>
' <columnNames>
'  <columnName>FirstName</columnName>
'  <columnName>LastName</columnName>
' </columnNames>
' <rows>
'  <row>
'   <column>Sue</column>
'   <column>Brown</column>
'  </row>
'  <row>
'   <column>Billy Bob</column>
'   <column>Jones</column>
'  </row>
...
' </rows>
'</people>

2) Sometimes the XML is:
'<people>
' <columnNames>
'  <columnName>LastName</columnName>
'  <columnName>FirstName</columnName>
' </columnNames>
' <rows>
'  <row>
'   <column>Brown</column>
'   <column>Sue</column>
'  </row>
'  <row>
'   <column>Jones</column>
'   <column>Billy Bob</column>
'  </row>
...
' </rows>
'</people>

3) I'm trying to receive it consistently, but the result may be based upon
who does the query. So, I'm wondering if there's an XPath expression that
can help for now?

NEEDED
======

I want to _always_ get the column corresponding to the "LastName" columnName
regardless of the position in the XML source (1 or 2, above).

'<xsl:template match="//row/column[ ??? = 'LastName' ]">

Gracias, Merci, Danke, Thank you!
Beverly


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread