[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Iterative XML Handling

Subject: Iterative XML Handling
From: Anthony.Behan@xxxxxxxxxxxxxxx
Date: Tue, 5 Oct 1999 12:28:44 +0100
xml handling

I have some XML as follows:

<addresses>
<address>
  <country>UK</country>
  <type>Billing</type>
  <lines>
  <line>add line text 1</line>
  <line>add line text 1</line>
  <line>add line text 1</line>
  <line />
  <line>add line text 1</line>
  <line />
  <line>add line text 1</line>
  </lines>
</address>
<address>
  <country>UK</country>
  <type>Service Address</type>
  <lines>
  <line />
  <line>add line text 2</line>
  <line />
  <line>add line text 2</line>
  <line>add line text 2</line>
  <line />
  <line>add line text 2</line>
  </lines>
</address>
</addresses>

My XSL for this code is...
<xsl:template match="invoices/invoice/header/addresses">
     <xsl:apply-templates/>
</xsl:template>

<xsl:template match="invoices/invoice/header/addresses/address">
     <xsl:apply-templates select type="Billing"/>
</xsl:template>

<xsl:template match="invoices/invoice/header/addresses/address/country">
</xsl:template>

<xsl:template match="invoices/invoice/header/addresses/address/type">
</xsl:template>

<xsl:template match="invoices/invoice/header/addresses/address/lines">
     <xsl:apply-templates/>
</xsl:template>

<xsl:template match="invoices/invoice/header/addresses/address/lines/line">
     <TR><TD>
     <xsl:apply-templates/>
     </TD></TR>
</xsl:template>

However, I only wish addresses to appear that are Billing addresses, and not
Service addresses (/invoices/invoice/header/addresses/address/type = "Billing").
How can this be achieved?  Is it possible with my current XML construction?

Thanks,

Anthony Behan.




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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.