Hi all,
I've just started to learn XSLT, so apologies if this question is very basic! I want to create a new html document, one of my elements in the XML file uses mixed elements. I want to do more complicated formatting using linked documents etc. but for the moment I am just trying to put one element in italics which is contained in an other element. I suspect I am be doing something wrong with how I am traversing the document or with the context. I will use dummy code here because the document is part of a proposal that I am working on.
Thanks in advance for any help, I have a feeling I may be something really silly!
.....
<abstract ref="A.2">
<transcription>
<p>Some text in here.. blah blah blah blah </p>
<p>Some more text here <t value="author">an authors name</t> even more text blah blah blah</p>
<p>even more text </p>
</transcription>
</abstract>
<?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" exclude-result-prefixes="xs"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" version="2.0">
<xsl:output encoding="UTF-8" method="html"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<!-- these are other elements which exist in the original xml document -->
<xsl:template match="//scene"/>
<xsl:template match="//title">
<h1>Title: <xsl:value-of select="."/></h1>
<h2>The following text is an abstract only.</h2>
</xsl:template>
<!-- t is the element which i what to italicize which is contained within p -->
<!--<xsl:template match="//t">
<i><xsl:value-of select="."/></i>
</xsl:template>-->
<xsl:template match="//p">
<p><xsl:value-of select="."/></p>
</xsl:template>
</xsl:stylesheet>