DISelect and the media attribute

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

DISelect and the media attribute

JOSE MANUEL CANTERA FONSECA

Hi,

Is this is allowed?

<style type="text/css" src="mystyle.css" media="DISelect expression 1" />
<style type="text/css" src="mystyle2.css" media="DISelect expression 2" />
<style type="text/css" src="mystyle4.css" media="DISelect expression 4" />

Or is it a better practice to put:

<sel:select>
  <sel:when expr="">
        <style type="text/css" src="mystyle.css" />
  </sel:when>
  <sel:when expr="">
        <style type="text/css" src="mystyle2.css" />
  </sel:when>
  <sel:otherwise>
    <style type="text/css" src="mystyle4.css" />
  </sel:otherwise>
</sel:select>  

?

Thanks for your responses

Reply | Threaded
Open this post in threaded view
|

RE: DISelect and the media attribute

Rhys Lewis

Hi Jose,

It is specifically allowed in the full profile of DISelect. Section 7 covers the use of AVTs to set host language attributes. So if your example were, for example, from DIAL, it would be fine. However, you do need the curly brackets to satisfy the AVT syntax, so I think you example would actually need to be:

<style type="text/css" src="mystyle.css" media="{DISelect expression 1}" />
<style type="text/css" src="mystyle2.css" media="{DISelect expression 2}" />
<style type="text/css" src="mystyle4.css" media="{DISelect expression 4}" />

You could of course also code it as

<style type="text/css" src="mystyle.css" expr="DISelect expression 1" />
<style type="text/css" src="mystyle2.css" expr="DISelect expression 2" />
<style type="text/css" src="mystyle4.css" expr="DISelect expression 4" />

where the expressions evaluate to true or false rather than to some value of media. The <select> element can also be used as you showed.

That's the trouble with flexibility, there are often several ways of achieving things!

Best wishes

Rhys

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of José Manuel Cantera Fonseca
Sent: 20 October 2006 08:07
To: [hidden email]
Subject: DISelect and the media attribute


Hi,

Is this is allowed?

<style type="text/css" src="mystyle.css" media="DISelect expression 1" />
<style type="text/css" src="mystyle2.css" media="DISelect expression 2" />
<style type="text/css" src="mystyle4.css" media="DISelect expression 4" />

Or is it a better practice to put:

<sel:select>
  <sel:when expr="">
        <style type="text/css" src="mystyle.css" />
  </sel:when>
  <sel:when expr="">
        <style type="text/css" src="mystyle2.css" />
  </sel:when>
  <sel:otherwise>
    <style type="text/css" src="mystyle4.css" />
  </sel:otherwise>
</sel:select>

?

Thanks for your responses



Reply | Threaded
Open this post in threaded view
|

Re: DISelect and the media attribute

JOSE MANUEL CANTERA FONSECA

Thanks Rhys, for your quick response.

Taking into account that different expression languages can be together
in authoring unit, wouldn't it be better to define a more specific
syntax for the expressions?

For example JSP 2.0 E.L. expressions are ${a.b > 5}.

DISelect expressions could be

diselect{<expression>}

Or, as DISelect are XPATH expressions, wouldn't it be better that the
expressions were as

xpath{<DISelectExpression>}

Defining the expressions with a prefix will make the specification more
extensible and could even incoporate in a future other E.L.s

What do you think?

Rhys Lewis escribió:

> Hi Jose,
>
> It is specifically allowed in the full profile of DISelect. Section 7 covers the use of AVTs to set host language attributes. So if your example were, for example, from DIAL, it would be fine. However, you do need the curly brackets to satisfy the AVT syntax, so I think you example would actually need to be:
>
> <style type="text/css" src="mystyle.css" media="{DISelect expression 1}" />
> <style type="text/css" src="mystyle2.css" media="{DISelect expression 2}" />
> <style type="text/css" src="mystyle4.css" media="{DISelect expression 4}" />
>
> You could of course also code it as
>
> <style type="text/css" src="mystyle.css" expr="DISelect expression 1" />
> <style type="text/css" src="mystyle2.css" expr="DISelect expression 2" />
> <style type="text/css" src="mystyle4.css" expr="DISelect expression 4" />
>
> where the expressions evaluate to true or false rather than to some value of media. The <select> element can also be used as you showed.
>
> That's the trouble with flexibility, there are often several ways of achieving things!
>
> Best wishes
>
> Rhys
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of José Manuel Cantera Fonseca
> Sent: 20 October 2006 08:07
> To: [hidden email]
> Subject: DISelect and the media attribute
>
>
> Hi,
>
> Is this is allowed?
>
> <style type="text/css" src="mystyle.css" media="DISelect expression 1" />
> <style type="text/css" src="mystyle2.css" media="DISelect expression 2" />
> <style type="text/css" src="mystyle4.css" media="DISelect expression 4" />
>
> Or is it a better practice to put:
>
> <sel:select>
>   <sel:when expr="">
> <style type="text/css" src="mystyle.css" />
>   </sel:when>
>   <sel:when expr="">
> <style type="text/css" src="mystyle2.css" />
>   </sel:when>
>   <sel:otherwise>
>     <style type="text/css" src="mystyle4.css" />
>   </sel:otherwise>
> </sel:select>
>
> ?
>
> Thanks for your responses
>
>
>
>
>  



Reply | Threaded
Open this post in threaded view
|

RE: DISelect and the media attribute

Rhys Lewis

Hi Jose,

The reasoning was that XSLT already defined {} as the syntax wrapper for AVT and we simply adopted it.

This is one of the things that we might revisit in a new revision of DISelect that used different expression languages. For the current spec, it's completely consistent, but I agree that for different expression languages, the tradeoffs are different.

Best wishes
Rhys

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: 20 October 2006 09:06
To: [hidden email]
Cc: [hidden email]
Subject: Re: DISelect and the media attribute

Thanks Rhys, for your quick response.

Taking into account that different expression languages can be together
in authoring unit, wouldn't it be better to define a more specific
syntax for the expressions?

For example JSP 2.0 E.L. expressions are ${a.b > 5}.

DISelect expressions could be

diselect{<expression>}

Or, as DISelect are XPATH expressions, wouldn't it be better that the
expressions were as

xpath{<DISelectExpression>}

Defining the expressions with a prefix will make the specification more
extensible and could even incoporate in a future other E.L.s

What do you think?

Rhys Lewis escribió:

> Hi Jose,
>
> It is specifically allowed in the full profile of DISelect. Section 7 covers the use of AVTs to set host language attributes. So if your example were, for example, from DIAL, it would be fine. However, you do need the curly brackets to satisfy the AVT syntax, so I think you example would actually need to be:
>
> <style type="text/css" src="mystyle.css" media="{DISelect expression 1}" />
> <style type="text/css" src="mystyle2.css" media="{DISelect expression 2}" />
> <style type="text/css" src="mystyle4.css" media="{DISelect expression 4}" />
>
> You could of course also code it as
>
> <style type="text/css" src="mystyle.css" expr="DISelect expression 1" />
> <style type="text/css" src="mystyle2.css" expr="DISelect expression 2" />
> <style type="text/css" src="mystyle4.css" expr="DISelect expression 4" />
>
> where the expressions evaluate to true or false rather than to some value of media. The <select> element can also be used as you showed.
>
> That's the trouble with flexibility, there are often several ways of achieving things!
>
> Best wishes
>
> Rhys
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of José Manuel Cantera Fonseca
> Sent: 20 October 2006 08:07
> To: [hidden email]
> Subject: DISelect and the media attribute
>
>
> Hi,
>
> Is this is allowed?
>
> <style type="text/css" src="mystyle.css" media="DISelect expression 1" />
> <style type="text/css" src="mystyle2.css" media="DISelect expression 2" />
> <style type="text/css" src="mystyle4.css" media="DISelect expression 4" />
>
> Or is it a better practice to put:
>
> <sel:select>
>   <sel:when expr="">
> <style type="text/css" src="mystyle.css" />
>   </sel:when>
>   <sel:when expr="">
> <style type="text/css" src="mystyle2.css" />
>   </sel:when>
>   <sel:otherwise>
>     <style type="text/css" src="mystyle4.css" />
>   </sel:otherwise>
> </sel:select>
>
> ?
>
> Thanks for your responses
>
>
>
>
>