[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

CSV output - select using xpath in variable

Subject: CSV output - select using xpath in variable
From: Nick Leaton <nickle@xxxxxxxxx>
Date: Fri, 11 Jun 2010 08:48:07 +0100
 CSV output - select using xpath in variable
I'm trying to get a variant on the XSLT cookbook template to output csv


Page 240-241

It uses XSLT 2.0 and parts of it are quite neat.

I like the idea of importing a generic module, and then defining the
columns to export in the importing module.

I want to extend it to hand different delimiters, in the same way, and
also different line terminators.

The next extension is correctly quoting the output if it containts
quotes in strings etc.

So far, I can do this.

However, there is one problem I can't solve.

My input data is not regular, but CSV output needs to be regular. So I
want to defined the column names like this


and the path names to get the data like this


The interesting part is the isin. To get the path from the input
fragment, it is an xpath.

So if I had

<xsl:variable name="path" select="instrument/isin" as="xs:string"/>


<xsl:variable name="message">

I want to do something like

     <xsl:value-of select="$message/$path"/>

and have it return US0123456789

What's the best way?


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.