Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting nodes from document() output

Status
Not open for further replies.

bpicke

Technical User
Jul 10, 2002
3
ES
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=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;Doctest1.xsl&quot;?>

<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=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>
<Passage>

<h3>NEW TIMBER WINDOWS TO BE COATED WITH <topcoat>topcoat </topcoat>
</h3>
<para><ol type=&quot;a&quot;><li type=&quot;a&quot;>The surface must be clean, dry and sound. </li>
<li type=&quot;a&quot;>All sharp edges and corners should be rounded off wherever possible to 3mm
radius.</li>
<li type=&quot;a&quot;>Remove any resinous exudation prior to treatment.</li>
<li type=&quot;a&quot;>Knots and resinous areas of timber need to be 'spot' treated with knotting. </li>
<li type=&quot;a&quot;>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=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;<xsl:eek:utput method=&quot;html&quot; encoding=&quot;ISO-8859-1&quot;/>
<xsl:template match=&quot;/&quot;>
<html>
<head>
<title>Redecoration</title>
<LINK REL=&quot;stylesheet&quot; Type=&quot;text/css&quot; HREF=&quot;sheet1.css&quot; />
</head>
<body>

<table width=&quot;70%&quot; align=&quot;left&quot; border=&quot;1&quot;>

<tr>
<td><xsl:value-of select=&quot;paint/Item1/Description1&quot;/></td>
<td><xsl:value-of select=&quot;paint/Item1/Elementsofwork1&quot;/></td>
<td><xsl:value-of select=&quot;paint/Item1/Material1&quot;/></td>
<td><xsl:value-of select=&quot;paint/Item1/Colour1&quot;/></td>
</tr>
<tr>
<td colspan=&quot;4&quot;><xsl:copy-of select=&quot;document('Report/Report13.xml')&quot;/></td></tr>
<tr><td colspan=&quot;4&quot;><xsl:call-template name=&quot;primer&quot; /></td></tr>
</table>

</body>
</html>
</xsl:template>

<xsl:template name=&quot;primer&quot;>
<xsl:value-of select=&quot;primer&quot; />
</xsl:template>

</xsl:stylesheet>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top