RE: Formatting elements

Subject: RE: Formatting elements
From: DPawson@xxxxxxxxxxx
Date: Wed, 11 Oct 2000 08:38:46 +0100
> i'm kind of new to this, are you two saying add xml tags for 
> the purpose of
> giving xslt processors a place to grab hold?
> 
> if so, how do you choose where to put these?

Example:

Original information is 3 levels of vat (state tax) available
in a database
    <vat>Vat Code 1 - Zero Rated</vat>
    <vat>Vat Code 2 - Vatable</vat>
    <vat>Vat Code 3 - Variable</vat>

I need to be able to select one of these dependent on another value.

If I have 
<template match="vat">

I'm then (positionally speaking) too low to do anything with them,
I'd need to start hunting for content.

   <rates>
    <vat>Vat Code 1 - Zero Rated</vat>
    <vat>Vat Code 2 - Vatable</vat>
    <vat>Vat Code 3 - Variable</vat>
   </rates>
 
Adding this wrapper, I now match on 'rates'
and can pick any child. 

A further use was to wrap even further, such that when the 
data was used for input, it could be shown as a pull down list
with a default. This gave the following. Now usable in two
different presentations. All solved with *adding* more wrappers.

 <vat>
   <rates>
    <vat>Vat Code 1 - Zero Rated</vat>
    <vat>Vat Code 2 - Vatable</vat>
    <vat>Vat Code 3 - Variable</vat>
   </rates>
   <sel-vat>Vat Code 2 - Vatable</sel-vat>
 </vat>

HTH DaveP


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


Current Thread