[oXygen-user] saxon -it switch from Oxygen?

Jon Crump
Tue Jan 16 12:06:42 CST 2007


Dear all,

Following an example In Michael Kay's book, I've got a rudimentary xsl 
transformation (appended below) for parsing a plain-text file. This works 
fine when invoked from the command line thus:

java -jar saxon8.jar -it main unparsed-text-test.xsl input-uri=temptesting

using the -it (initial template) switch. I can't figure out how to make 
this happen from within oXygen. Running the style sheet from within oX 
gets me this error:

SystemID: /Users/jjc/Desktop/temptesting Location: 1:1 Description: 
Content is not allowed in prolog.

oXygen insists on expecting the input file to be well formed XML. I'm sure 
I'm missing something obvious. Any help?

Jon


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     version="2.0">

     <xsl:param name="input-uri" select="temptesting" as="xs:string"/>
     <xsl:output indent="yes" method="xml"/>

     <xsl:template name="main" >
         <xsl:variable name="in" select="unparsed-text($input-uri, 
'UTF-8')"/>
         <table>
             <xsl:analyze-string select="$in" regex="\n">
                 <xsl:non-matching-substring>
                     <row>
                         <xsl:for-each select="tokenize(., ': ')">
                             <xsl:variable name="chunk" select="."/>
                                 <cell>
                                     <xsl:value-of select="$chunk"/>
                                 </cell>
                         </xsl:for-each>
                     </row>
                 </xsl:non-matching-substring>
             </xsl:analyze-string>
         </table>
     </xsl:template>

</xsl:stylesheet>


__________
J.J. Crump
Dept. of History 353560
University of Washington
Seattle, WA. 98195





More information about the oXygen-user mailing list