Subject: Re: [xsl] Writing array elements based on a an evaluation of one of the child elements From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 24 May 2006 12:44:12 -0400 |
<xsl:template match="ACCOUNT-LIST"> <xsl:copy-of select="self::*[normalize-space(ACCOUNT-NO)]"/> </xsl:template>
Cheers, Wendell
There are several occurences of ACCOUNT-LIST each with the same 3 child elements.
The first child element in any occurence of ACCOUNT-LIST is ACCOUNT-NO
Should this ACCOUNT-NO element have no value (which I am trying to determine by assesing the string-length of ACCOUNT-NO/text()) then I do not want to write the entire ACCOUNT-LIST element for the specific occurence.
therefore looking at the example below, I want to only have the first 2 occurences of the ACCOUNT-LIST appear in my result
XML I Get ...
<?xml version="1.0" encoding="UTF-8"?> <Get_AccountNumber_List> <CLIENT_CODE6>BABICK 001</CLIENT_CODE6> <ACCOUNT-LIST> <ACCOUNT-NO>0000000054840004</ACCOUNT-NO> <SBU-CODE>2</SBU-CODE> <RISK_TYPE>CUR</RISK_TYPE> </ACCOUNT-LIST> <ACCOUNT-LIST> <ACCOUNT-NO>0000000710207909</ACCOUNT-NO> <SBU-CODE>2</SBU-CODE> <RISK_TYPE>CMS</RISK_TYPE> </ACCOUNT-LIST> <ACCOUNT-LIST> <ACCOUNT-NO></ACCOUNT-NO> <SBU-CODE></SBU-CODE> <RISK_TYPE></RISK_TYPE> </ACCOUNT-LIST> </Get_AccountNumber_List>
XML I WANT...
<?xml version="1.0" encoding="UTF-8"?> <Get_AccountNumber_List> <CLIENT_CODE6>BABICK 001</CLIENT_CODE6> <ACCOUNT-LIST> <ACCOUNT-NO>0000000054840004</ACCOUNT-NO> <SBU-CODE>2</SBU-CODE> <RISK_TYPE>CUR</RISK_TYPE> </ACCOUNT-LIST> <ACCOUNT-LIST> <ACCOUNT-NO>0000000710207909</ACCOUNT-NO> <SBU-CODE>2</SBU-CODE> <RISK_TYPE>CMS</RISK_TYPE> </ACCOUNT-LIST> </Get_AccountNumber_List>
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Writing array elements ba, neil cave | Thread | Re: [xsl] Writing array elements ba, Jon Gorman |
Re: [xsl] xsl:for or xsl:repeat, Jon Gorman | Date | Re: [xsl] xsl:for or xsl:repeat, Wendell Piez |
Month |