This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Displaying every 2 element values in 1 rowyy


> Mike,Sorry for prolonging this question.But what am I doing wrong here?.
> 
> This is my xml
> <empdb>
>     <emp>
>         <eno>A21</eno>
>     </emp>
 [etc]
> </empdb>
 
Well how can I write a solution for you if you are going to keep changing
the XML on me?

> And I used ur xsl as follows:
> 
> <xsl:template match="empdb//emp">

Here you are saying you want this template to match an 'emp' element that
is a descendant of an 'empdb' element. This will match any of the 'emp'
elements in your document. That might be OK, but there are 2 things you
have to consider: 

 1. How did you arrive at an 'emp' element that this template is matching?
Did built-in templates get you here? Are you going to be arriving at
every 'emp' or just some of them? The match attribute here has nothing to
do with this. Look at the apply-templates instructions in other templates,
including built-in ones.

 2. Is the template going to do what you want to do when you arrive at an
'emp' element? I wrote it for the simpler case of many 'eno' elements in a
single container.

I'm not going to write another solution for you again.

   - Mike
___________________________________________________________
Mike J. Brown, software engineer, Webb Interactive Services
XML/XSL stuff: http://www.skew.org/    http://www.webb.net/


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]