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

RE: Execute Stylesheet

Subject: RE: Execute Stylesheet
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 7 Mar 2008 19:46:15 -0000
RE:  Execute Stylesheet
> My question is how do I actually run this stylesheet?  I am 
> used to running a stylesheet against an xml file but I am at 
> a loss as to how to execute this one against the text file?  
> Can I run it from within Oxygen or do I need to run it with a 
> command line?

You can do either.

I would change the argument to unparsed-text() to
"file:///c:/comma_delimited.txt". The spec requires a URI here, not a
Windows filename. Some environments might let you get away with the
filename, but it all depends on your configuration.

I would also, as Colin suggests, add name="entry" to your initial template
so you don't have to supply a dummy source file. But keep the match="/" as
well for the time being if you ever want to run it with Altova, which
doesn't yet support entry at a named template.

Michael Kay
http://www.saxonica.com/

> 
> I am using XSLT 2.0 (Saxon)
> 
> My (copied) stylesheet is as follows
> 
> <xsl:stylesheet 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
>     <xsl:variable name="in" 
> select="unparsed-text('c:\comma_delimited.txt')"/>
>     <xsl:template match="/">
>         <xsl:variable name="tokenizedSample" 
> select="tokenize($in,',')"/>
>          <xsl:for-each select="$tokenizedSample">
>             <xsl:value-of select="."/>
>             <xsl:text>! </xsl:text>
>         </xsl:for-each>
>      </xsl:template>
>  </xsl:stylesheet>
> 
> Thanks
> --
> Sean

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.