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

Re: reading a text file and putting out an xml file us

Subject: Re: reading a text file and putting out an xml file using xslt 2.0
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 28 Oct 2009 15:30:04 +0100
Re:  reading a text file and putting out an xml file us
a kusa wrote:

I have an input file which is a text file. My output should be an XML
file that conforms to a schema that I already have.

How do I do this in XSLT2.0? Can I use unparsed-text() function? Are
there any examples that I can look at for this?

An XSLT 2.0 processor should allow you to start processing with a named template so in your stylesheet you would write a named template e.g.
<xsl:template name="main">
<xsl:variable name="t1" select="unparsed-text('input.txt')"/>
<!-- now process t1 here perhaps by tokenizing -->
</xsl:template>
then you would instruct the XSLT processor to start with template named "main" (e.g. option -it:main in Saxon or /n main with Altova I think).




--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

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.