xsl-list
[Top] [All Lists]

Re: Variables and Values

2004-03-24 01:00:04
Hi Wendell,

But don't go away thinking that 
you *must* do this because it's intrinsically difficult in XSLT to provide 
a default value when none is available in the source. It's not.

In hind sight it is actually more logical to preprocess the data.  The 
application used to contain the code to collect the data via interactive 
questionnaires, process it and then do the merge - it makes more sense to 
stick the processing in with the data collection.

Stretch your brain to accommodate the 
kind of technique that Andreas suggested, for example, and you find soon 
enough that XSLT provides alternatives to the techniques you know, that may 
require a little getting used to, but that are extremely powerful, 
flexible, and simple to use once you get the hang of it all.

I can see what Andreas is doing, however it doesn't provide a total solution.  
The sort of logic I am trying to replace is as follows:

IF NOT ANSWERED( PWQ )
  SET PWQ TO FALSE
END IF
IF Rerun = FALSE
  SET RBSchild TO FALSE
END IF
IF Draft = TRUE
  SET Plan1 TO TRUE
END IF
IF TestDetyn = TRUE
  SET Plan7 TO FALSE
ELSE IF TestDetyn = FALSE
  SET Plan7 TO TRUE
END IF
IF Mirroryn = FALSE
  SET Singleyn TO TRUE
END IF

OK, the original logic (this is only a fraction of it) needs to be sorted 
though because there are a number of diuplicates, however I will still need to 
be able to set a value and then change it later based on some other condition.

I would be interested to know if there is an XSL way to do that.

-- 
Cheers,

Julian Voelcker
United Kingdom




<Prev in Thread] Current Thread [Next in Thread>