This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: transforming Content Markup (not presentation) similar to MML
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] transforming Content Markup (not presentation) similar to MML
- From: Dan Diebolt <dandiebolt at yahoo dot com>
- Date: Wed, 9 May 2001 08:59:16 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
DC>The logic for handling precedence _ought_ be the same as in a
DC>ContentML to Presentation ML stylesheet didn't it?
Thanks, that stylesheet should prove very useful! I should be able
to use the existing precedence but I need to add more for program
flow consturcts. MML has representation for piecewise functions,
for example absolute value:
abs(x)= -x if x<0
= 0 if x=0
= x if x>0
<apply>
<eq/>
<apply>
<abs/>
<ci> x </ci>
</apply>
<piecewise>
<piece>
<apply><minus/><ci> x </ci></apply>
<apply><lt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<cn> 0 </cn>
<apply><eq/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
<piece>
<ci> x </ci>
<apply><gt/><ci> x </ci> <cn> 0 </cn></apply>
</piece>
</piecewise>
</apply>
If I wanted general purpose "if" statement for example (the same
applies to other program flow constructs), would I be better off
introducing new elements or mutating an existing MML element?
Consider:
if (x<0) {
x=-x;
else if (x>0) {
x=x;
} else
x=0;
}
<if>
<condition>
<apply>
<lt/>
<ci>x</ci>
<cn>0</cn>
</apply>
</condition>
<apply>
<eq/>
<cn>x</cn>
<cn>x</cn>
</apply>
<elseif>
<condition>
<apply>
<gt/>
<ci>x</ci>
<cn>0</cn>
</apply>
</condition>
<apply>
<eq/>
<cn>x</cn>
<apply>
<minus/>
<cn>x</cn>
</apply>
</apply>
</elseif>
<else>
<apply>
<eq/>
<cn>x</cn>
<ci>0</ci>
</apply>
</else>
</if>
How badly do I abuse MML's equal operator in using it as an assignment
statement:
y=x;
<apply>
<eq/>
<cn>y</cn>
<cn>x</cn>
</apply>
Has this issue been discussed elsewhere?
Regards,
Dan
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list