Re: Xalan to transform only selected elements of XML

Subject: Re: Xalan to transform only selected elements of XML
From: "P. DEXTER" <jishow@xxxxxxxxx>
Date: Wed, 31 May 2000 06:31:35 -0700 (PDT)
> So the question is:
> how can I transform only selected elements and not >
> all elements of XML?

Thanks to Morten Primdahl, Mike Brown and Heather
Lindsay for your inputs. 

Morten -- Your suggestion is valid, but is there a
generic solution? 
such that I do not have to change my .XSL file every
time I have new element in XML file,
that I do not want in the resulting transoformation. 

Mike -- The elements in XML file do not have any
attributes. i.e. 
My XML is:
<?xml version="1.0"?>
	<Address1>123 Bumpy Fast Lane</Address1>

My XSL is:
<xsl:stylesheet version="1.0"
  <xsl:template match="Policy">
  <xsl:template match="Insured">

  <xsl:template match="FirstName">
        <b>First Name:</b>
        <xsl:value-of select="."/>

  <xsl:template match="LastName">
        <b>Last Name:</b>
        <xsl:value-of select="."/>

  <xsl:template match="Zip">
        <xsl:value-of select="."/>

But, undesired Result is :
<b>First Name:</b>John
<b>Last Name:</b>Smith
123 Fast Lane
<b>Zip: 12345</b>

My Desired Result:

<b>First Name:</b>John
<b>Last Name:</b>Smith

How can I reach to my desired result?
Thanks for your help.

Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.

 XSL-List info and archive:

Current Thread