Hi
Panic attack. I have three files, a source document, a stylesheet and a second source document. The transformation results in output in which data extracted from the first source is followed by the whole of the second source file and presented in a table. Now I want to swap three nodes in the output from source two for nodes taken from source one. I can't even access a node from source two - see template "primer". Does anyone know how to do this or what is wrong with my code? Gratitude for any help.
Source One Doctest1.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="Doctest1.xsl"?>
<paint>
<Item1>
<Scope1>Frames and rails</Scope1>
<Description1>New timber windows</Description1>
<ScopeID1>13</ScopeID1>
<Elementsofwork1>Windows; </Elementsofwork1>
<Structure1>Timber; </Structure1>
<Material1>Demidekk Optimal</Material1>
<Colour1>red</Colour1>
<Primer1>Butinox 1</Primer1>
<Pcoats1>1</Pcoats1>
<Topcoat1>Demidekk Optimal</Topcoat1>
<Tcoats1>2</Tcoats1>
</Item1>
</paint>
Source Two (Report13.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<Passage>
<h3>NEW TIMBER WINDOWS TO BE COATED WITH <topcoat>topcoat </topcoat>
</h3>
<para><ol type="a"><li type="a">The surface must be clean, dry and sound. </li>
<li type="a">All sharp edges and corners should be rounded off wherever possible to 3mm
radius.</li>
<li type="a">Remove any resinous exudation prior to treatment.</li>
<li type="a">Knots and resinous areas of timber need to be 'spot' treated with knotting. </li>
<li type="a">Main preparation should be completed before application of materials, if
rubbing down between coats is necessary this should be carried out with a fine
scotchbright pad.</li></ol> </para>
<h4>Application </h4>
<para>Apply 1 coat of <primer>Primer </primer>
To be given to frames prior to despatch to site and should be kept if possible under
cover until required.</para>
<para>Followed by
<Coats>coats</Coats>
of <topcoat>topcoat</topcoat>
which should be applied as soon as possible after
fixing in situ and glazing. </para>
<para>In cold and damp conditions, drying times maybe extended.
Thinning of the material is not required.</para>
<para>Internal and external coatings should be taken onto the glass by approximately 2mm.
An extra coat will be required if light or bright colours are required.</para>
</Passage>
Style sheet Doctest1.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xslutput method="html" encoding="ISO-8859-1"/>
<xsl:template match="/">
<html>
<head>
<title>Redecoration</title>
<LINK REL="stylesheet" Type="text/css" HREF="sheet1.css" />
</head>
<body>
<table width="70%" align="left" border="1">
<tr>
<td><xsl:value-of select="paint/Item1/Description1"/></td>
<td><xsl:value-of select="paint/Item1/Elementsofwork1"/></td>
<td><xsl:value-of select="paint/Item1/Material1"/></td>
<td><xsl:value-of select="paint/Item1/Colour1"/></td>
</tr>
<tr>
<td colspan="4"><xsl:copy-of select="document('Report/Report13.xml')"/></td></tr>
<tr><td colspan="4"><xsl:call-template name="primer" /></td></tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template name="primer">
<xsl:value-of select="primer" />
</xsl:template>
</xsl:stylesheet>
Panic attack. I have three files, a source document, a stylesheet and a second source document. The transformation results in output in which data extracted from the first source is followed by the whole of the second source file and presented in a table. Now I want to swap three nodes in the output from source two for nodes taken from source one. I can't even access a node from source two - see template "primer". Does anyone know how to do this or what is wrong with my code? Gratitude for any help.
Source One Doctest1.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="Doctest1.xsl"?>
<paint>
<Item1>
<Scope1>Frames and rails</Scope1>
<Description1>New timber windows</Description1>
<ScopeID1>13</ScopeID1>
<Elementsofwork1>Windows; </Elementsofwork1>
<Structure1>Timber; </Structure1>
<Material1>Demidekk Optimal</Material1>
<Colour1>red</Colour1>
<Primer1>Butinox 1</Primer1>
<Pcoats1>1</Pcoats1>
<Topcoat1>Demidekk Optimal</Topcoat1>
<Tcoats1>2</Tcoats1>
</Item1>
</paint>
Source Two (Report13.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<Passage>
<h3>NEW TIMBER WINDOWS TO BE COATED WITH <topcoat>topcoat </topcoat>
</h3>
<para><ol type="a"><li type="a">The surface must be clean, dry and sound. </li>
<li type="a">All sharp edges and corners should be rounded off wherever possible to 3mm
radius.</li>
<li type="a">Remove any resinous exudation prior to treatment.</li>
<li type="a">Knots and resinous areas of timber need to be 'spot' treated with knotting. </li>
<li type="a">Main preparation should be completed before application of materials, if
rubbing down between coats is necessary this should be carried out with a fine
scotchbright pad.</li></ol> </para>
<h4>Application </h4>
<para>Apply 1 coat of <primer>Primer </primer>
To be given to frames prior to despatch to site and should be kept if possible under
cover until required.</para>
<para>Followed by
<Coats>coats</Coats>
of <topcoat>topcoat</topcoat>
which should be applied as soon as possible after
fixing in situ and glazing. </para>
<para>In cold and damp conditions, drying times maybe extended.
Thinning of the material is not required.</para>
<para>Internal and external coatings should be taken onto the glass by approximately 2mm.
An extra coat will be required if light or bright colours are required.</para>
</Passage>
Style sheet Doctest1.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xslutput method="html" encoding="ISO-8859-1"/>
<xsl:template match="/">
<html>
<head>
<title>Redecoration</title>
<LINK REL="stylesheet" Type="text/css" HREF="sheet1.css" />
</head>
<body>
<table width="70%" align="left" border="1">
<tr>
<td><xsl:value-of select="paint/Item1/Description1"/></td>
<td><xsl:value-of select="paint/Item1/Elementsofwork1"/></td>
<td><xsl:value-of select="paint/Item1/Material1"/></td>
<td><xsl:value-of select="paint/Item1/Colour1"/></td>
</tr>
<tr>
<td colspan="4"><xsl:copy-of select="document('Report/Report13.xml')"/></td></tr>
<tr><td colspan="4"><xsl:call-template name="primer" /></td></tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template name="primer">
<xsl:value-of select="primer" />
</xsl:template>
</xsl:stylesheet>