Subject: RE: [xsl] XSLT document() function!!!! From: Américo Albuquerque <melinor@xxxxxxx> Date: Fri, 8 Aug 2003 22:17:29 +0100 |
Hi. > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > michel geadah > Sent: Friday, August 08, 2003 9:16 AM > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] XSLT document() function!!!! > > > HI... > A little question: > My input xml document (BBSD_CUSTOMERS.xml) is: > > <?xml version="1.0" encoding="utf-8" ?> > <BBSD_CUSTOMERS> > <mappings Record="1"> > <CUST_B_NAME>AAA</CUST_B_NAME> > <CUST_S_NAME>AAAA</CUST_S_NAME> > </mappings> > <mappings Record="2"> > <CUST_B_NAME>BBB</CUST_B_NAME> > <CUST_S_NAME>BBBB</CUST_S_NAME> > </mappings> > etc.. > </BBSD_CUSTOMERS> > > My xslt document (BBSD_CUSTOMERS.xsl) is: > > <?xml version="1.0" encoding="utf-8" ?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0"> > <xsl:output method="xml" /> > <xsl:variable name="FILE" > select="document('BBSD_CUST_ADDRESSES.xml')"/> > <xsl:template match="/"> > <xsl:element name="WCUSTOMERS"> > <xsl:for-each select="//BBSD_CUSTOMERS/mappings"> > <xsl:element name="{name()}"> > > > <EMAIL> > <xsl:apply-templates select="$FILE/BBSD_CUST_ADDRESSES > /mappings/CADR_E_MAIL_1"/> Here is your problem, you are selecting all email at once and, because of that, they are beeing copyied to the result tree. What yout is: <xsl:apply-templates select="$FILE/BBSD_CUST_ADDRESSES/mappings[@Record=current()/@Record]/CADR_E _MAIL_1"/> Filter the email so the mappings/@Record is equal to the current one --^ (...) Regards, Americo Albuquerque XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT document() function!, Mukul Gandhi | Thread | [xsl] Output XML in HTML to multipl, Patrick van Halderen |
Re: [xsl] Transforming using DOMSou, Tim Meals | Date | RE: [xsl] Unexpected behavior with , Américo Albuquerque |
Month |