[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Writing array elements based on a an evaluation of
Subject: Re: 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
At 09:00 AM 5/24/2006, you wrote:
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
======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|