[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Appl templates


Subject: RE: [xsl] Appl templates
From: "John Wang" <jwang@xxxxxxxxxxx>
Date: Thu, 26 Apr 2001 15:27:36 -0500

try this.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:template match="policy">
		<html>
			<body>
				<xsl:apply-templates select="Insurer[@ref=&apos;Insur&apos;]/Name"/>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="Name" name="CoName">
		<b>Company Name :</b>
		<xsl:value-of select="."/>
		<br/>
	</xsl:template>
</xsl:stylesheet>

-John
-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Jason Swalwell
Sent: Wednesday, April 25, 2001 11:20 AM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: [xsl] Appl templates

Hi

I am having problems using apply templates all I want to return is the name
ie Big insurance company, trouble is that I keeping getting everything
returned.
<policy>
        <Insurer ref="Insur">
                <Name>Big Insurance Company Ltd</Name>
                <Established>1976-02-10T00:00:00.00</Established>
                <PointOfContact ref="A" xsi:type="Employee">
                        <Name>
                                <Title>Mr</Title>
                                <Forename>Sam</Forename>
                                <Middlename/>
                                <Surname>Jones</Surname>
                                <Suffix/>
                        </Name>
                        <Position>Underwriter</Position>
                        <Department>Household Schemes</Department>
                </PointOfContact>
                <Address xsi:type="UKAddress">
                        <AddressHeader>Big House</AddressHeader>
                        <AddressLine>West Big Park</AddressLine>
                        <Town>Richtown</Town>
                        <County>Nearby</County>
                        <Country/>
                        <Postcode>AA1 1AA</Postcode>
                </Address>
                <CommunicationsChannel xsi:type="Telephone">
                        <PhoneType>Work</PhoneType>
                        <CountryCode/>
                        <AreaCode>01786</AreaCode>
                        <TelephoneNumber>657483 ext45</TelephoneNumber>
                </CommunicationsChannel>
        </Insurer>
</policy>

and a style sheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
        <xsl:template match="Policy">
                <xsl:apply-templates select="Insurer[@ref='Insur']" "/>
        </xsl:template>


        <xsl:template match="Name" name="CoName">
        <b>Company Name :</b> <xsl:value-of select="."/><br/>
        </xsl:template>

        </xsl:stylesheet>




The information in this E-Mail is confidential and may be legally
privileged. It may not represent the views of WebX Limited. It is intended
solely for the addressees. Access to this E-Mail by anyone else is
unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.  Any unauthorised recipient should
advise the sender immediately of the error in transmission.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread