[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: transforming Content Markup (not presentation) sim

Subject: Re: transforming Content Markup (not presentation) similar to MML
From: Dan Diebolt <dandiebolt@xxxxxxxxx>
Date: Wed, 9 May 2001 08:59:16 -0700 (PDT)
xsl not eq
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.