xsl-list
[Top] [All Lists]

Re: Match first non-empty from different fragments

2005-01-20 08:12:14
Well,
There are man z:row elements node with attribute value pairs.  So like this:

<z:row name_of_meet="Funtastic" date_of_meet="10/10/2005"/>

Currently, I would ask the question (assuming above is current node).
(in plain english)
If name_of_meet is empty, then find the parent record name_of_event.

The parent record is contained within the XML source but spawns off
another fragment.  Here, let me do up an example:

 <results>
   <result name="event"><!-- this is the parent -->
     <xml>
        <rs:data>
             <z:row name_of_event="The Great Funtastic"
date_of_meet="10/10/2005"/>
        <rs:data>
     </xml>
   </result>
   <result name="meet"><!-- this is the child -->
        <rs:data><z:row name_of_event="" date_of_meet="10/10/2005"/>
</rs:data>
   </result>
 </results>

There is another <result / > set of data, it is called "scores".
This data is the meat of the page.  There are many scores, with a
single header of data from either the "meet" result set or the "event"
result set where no data is provided in the child "meet" result set.

In my template I pretty much have 2 main apply-template rules.
apply-templates:  for meet header information
apply-templates:  for all of the scores.

It is the first of these 2 that I need to come up with a way at
getting at the details using an apply-templates over xsl:choose type
syntax.

I'll leave it at that for now!
Let me know if I need to provide more information.

Karl

On Thu, 20 Jan 2005 09:36:10 +0200, Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com
<Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com> wrote:
Hi,

Do you call it a fragment?  Not sure - this type of verbiage always
confuses me.  Anyhow...

I have a parent and child arrangment of data, they are events.  An
event may have many meets so the event acts as the parent and the meet
the child.  The child event inherits information from the parent event
when no information for the child meet is provided; example:  if meet
name is blank, use event name.

Currently, I am doing a pretty yucky XSL:CHOOSE to accomplish the
above, but I'd much rather accomplish with an APPLY-TEMPLATES...  The
source of the data is something like this:

<results>
  <result name="event">
    <xml>
       <rs:data><z:row /></rs:data>
    </xml>
  </result>
  <result name="meet">
       <rs:data><z:row /></rs:data>
  </result>
</results>

Typically I would apply-templates on the result who's name is "meet",
then match on the rs:data and explicitly write out the z:rows to my
HTML.  That make sense?
The explicit z:row value of's is what throws me off and forces me to
do the XSL:CHOOSE.

Any ideas on a better approach?  Hope I'm not too vague, if so I can
provide more details!

Please do, I don't really understand what you're doing with the xsl:choose 
processing and when you mention the value of z:row, it's sort of hard to see 
what you mean given the fact that z:row elements have no content or 
attributes.

Cheers,

Jarno

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--