<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="../../../_utils/schema/yaps.rnc" type="application/relax-ng-compact-syntax"?>
<?xml-model href="../../../_utils/schema/yaps.isosch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-stylesheet type="text/xsl" href="yaps2slidy1.xslt"?>
<!-- $Id: djb_transformations-in-oxygen.xml 51709 2026-05-28 23:29:13Z syd $ -->
<TEI xmlns="http://www.wwp.northeastern.edu/ns/yaps">
	<teiHeader>
		<fileDesc>
			<titleStmt>
				<title>Transforming XML using XSLT</title>
				<author>David J. Birnbaum</author>
			</titleStmt>
			<editionStmt>
				<edition>DHSI 2013, University of Victoria</edition>
			</editionStmt>
			<publicationStmt>
				<distributor>Women Writers Project (via website)</distributor>
				<address>
					<addrLine>url:mailto:wwp@northeastern.edu</addrLine>
				</address>
				<date when="2013-06-06"/>
				<availability status="restricted">
					<p>Copyright 2011 David J. Birnbaum and the Women Writers Project</p>
					<p>This TEI-encoded XML file is available under the terms of the <ref
							target="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons
							Attribution-ShareAlike 3.0 (Unported)</ref> license.</p>
				</availability>
				<pubPlace>Providence, RI USA</pubPlace>
			</publicationStmt>
			<sourceDesc>
				<p>Instructions on a variety of ways to perform XSLT transformations, mostly in
					oXygen</p>
			</sourceDesc>
		</fileDesc>
		<revisionDesc>
			<change when="2016-01-04" who="personography.xml#ksmith.awh">Added tutorials on all
				slides</change>
		</revisionDesc>
	</teiHeader>
	<text>
		<presentation>
			<abstract>
				<p>This tutorial is meant to introduce the XSLT debugger view in Oxygen. It is a
					supplement to the XSLT Introduction tutorial that covers the mechanics of using
					XSL files to transform XML files into plain text, and into XHTML. This tutorial
					is important for using the example files in this and other XSLT tutorials.</p>
			</abstract>
			<section>
				<head>Transforming XML to text using XSLT using Saxon inside &lt;oXygen/&gt;</head>
				<slide>
					<list>
						<item>Open <title>Hamlet</title> XML (<ref
								target="../../demos/xslt_intro/ham.xml">ham.xml</ref>)</item>
						<item>Open XSLT (<ref
								target="../../demos/xslt_intro/djb_transformations_transform-first.xsl"
								>djb_transformations_transform-first.xsl</ref>)</item>
					</list>
					<p><figure>
							<graphic url="../../../_utils/gfx/djb_transformations_save-file.png"
								width="100%"/>
							<figDesc>Oops! Where did the figure go?</figDesc>
						</figure></p>
					<list>
						<item>Switch to the XSLT debugger</item>
						<item>Select the XSLT engine (accept the Saxon-HE default)</item>
						<item>Verify that you’ve chosen the correct XML and XSLT files</item>
						<item>(Optional: Specify an output filename to save output)</item>
						<item>Run the transformation straight through (click on blue arrow)</item>
						<item>Examine the output as text</item>
					</list>
				</slide>
				<tutorial>
					<p>This tutorial is meant to introduce you to the XSLT debugger view in Oxygen.
						For this tutorial, you should have &lt;oXygen&gt; downloaded. If you have not
						set it up already, please visit the <ref target="../../../../tutorial_setup"
							>tutorial setup page</ref>. These slides will cover the mechanics of
						using XSL files to transform XML files into plain text, and into XHTML.</p>
					<p>Open the two files linked on the slide and follow the instructions to set up
						the XSLT debugger view. Once open, follow the instructions to transform
						ham.xml into a text file.</p>
					<p>Pay particular attention to the comments in
						djb_transformationss_transform-first.xsl, they can help you understand what
						gets processed from ham.xml and what is ignored.</p>
				</tutorial>
			</section>
			<section>
				<head>Transforming XML to XHTML using XSLT using Saxon inside &lt;oXygen/&gt;</head>
				<slide>
					<list>
						<item>Open <title>Hamlet</title> XML (<ref
								target="../../demos/xslt_intro/ham.xml">ham.xml</ref>)</item>
						<item>Open XSLT (<ref
								target="../../demos/xslt_intro/djb_transformations_transform-second.xsl"
								>djb_transformations_transform-second.xsl</ref>)</item>
					</list>
					<p><figure>
							<graphic url="../../../_utils/gfx/djb_transformations-second.png"
								width="100%"/>
							<figDesc>Oops! Where did the figure go?</figDesc>
						</figure></p>
					<list>
						<item>Switch to the XSLT debugger</item>
						<item>Select the XSLT engine (accept the Saxon-HE default)</item>
						<item><emph>Check the XHTML box</emph></item>
						<item>Verify that you’ve chosen the correct XML and XSLT files</item>
						<item>(Optional: Specify an output filename to save output)</item>
						<item>Run the transformation straight through (click on blue arrow)</item>
						<item>Examine the output <emph>as XHTML and text</emph></item>
					</list>
				</slide>
				<tutorial>
					<p>Keep ham.xml open and download the second XSLT stylesheet. Once open, follow
						the instructions to transform ham.xml into XHTML. The debugger view allows
						for you to preview XHTML pages in Oxygen, but you can set a location for
						your output file, then open that file in a browser (or upload it to your
						server).</p>
					<p>Again, the comments (on djb_transformationss_transform-second.xsl) are helpful
						to understand which elements are processed from ham.xml and which are
						ignored based on the stylesheet.</p>
				</tutorial>
			</section>
			<section>
				<head>Configuring a transformation scenario</head>
				<slide>
					<list>
						<item>Click on the wrench with the red triangle or type Ctrl-Shift-c
							(Cmd-Shift-c on Mac)</item>
						<item>Scenario type is <code>XML transformation with XSLT</code></item>
						<item>Save as <emph>project</emph> scenario</item>
						<item>Create a <emph>new</emph> scenario</item>
						<item>XSLT tab<list>
								<item><label>XML URL:</label> use the default of
										<code>${currentFileURL}</code></item>
								<item><label>XSL URL:</label> browse to your XSLT file</item>
								<item><label>Transformer:</label> use Saxon-HE</item>
							</list></item>
						<item>Output tab <list>
								<item><label>Save As:</label> Browse to wherever you want to save
									the output</item>
								<item>Check preferences (suggested: “Open in browser” and either
									“Open in Editor” or one of the “Show As” options)</item>
							</list></item>
					</list>
				</slide>
				<tutorial>
					<p>To configure a transformation scenario, follow the instructions included
						here. You may want to do this when you have a project that will reuse an
						XSLT file for multiple XML files, or if working in the XSLT debugger view is
						too cramped for you. </p>
				</tutorial>
			</section>
			<section>
				<head>Transforming XML to XHTML using saxon from the command line</head>
				<slide>
					<list>
						<item>Install command-line saxon processor and add to path</item>
						<item>Save XML and XSLT to the same directory<list>
								<item>Convenient for one-off projects</item>
								<item>For reuse of XSLT, save it to a library directory, but you
									then need to specify the path</item>
							</list></item>
						<item>Syntax<list>
								<item>Create an alias or batch file<list>
										<item>Not required, but strongly recommended for
											convenience</item>
										<item>Set the name <emph>saxon</emph> to, e.g., <emph>java
												-jar c:\bin\saxon_9.2\saxon9he.jar</emph></item>
									</list></item>
								<item>saxon -o outputfilename xmlfilename xsltfilename</item>
								<item>saxon -o sample.html input.xml transform-input.xsl</item>
								<item>Other command-line switches are available</item>
							</list></item>
					</list>
				</slide>
				<tutorial>
					<p>Follow the instructions on this slide to transform XML to XHTML from the
						command line. If you are familiar with using the command line, we recommend
						using this resource: <ref
							target="http://www.saxonica.com/html/documentation/using-xsl/commandline.html"
							>Running XSLT From the Command Line</ref>. </p>
					<list>
						<head>This tutorial is complete, please see links below to continue:</head>
						<item><ref target="../xslt_intro/xslt_processing_tutorial_00.xhtml">Proceed
								to next tutorial in Transformation and Publication
							Primer</ref></item>
						<item><ref target="../../../../resources/transformation.html">Return to
								Transformation and Publication Primer</ref></item>
						<item><ref target="../../../../resources/tutorial_main.html">Return to main
								tutorial page</ref></item>
					</list>
				</tutorial>
			</section>
		</presentation>
	</text>

</TEI>
