xsl-list
[Top] [All Lists]

Re: [xsl] reading a text file and putting out an xml file using xslt 2.0

2009-10-28 11:13:08
Thank you. I have saxon9 downloaded. But I am not sure how to run a
transformation on the command line for a text input.
Any help?

On Wed, Oct 28, 2009 at 9:30 AM, Martin Honnen 
<Martin(_dot_)Honnen(_at_)gmx(_dot_)de> wrote:
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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--