CDATA and disable-output-escaping use in a theme file (xsl)

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

CDATA and disable-output-escaping use in a theme file (xsl)

Hoi Chong
Hi,
I am creating a new theme to be use within Orbeon and I need to put the
following fragment into the HEAD section of the generated HTML file...

<!--[if lte IE 6]> <link rel="stylesheet"
href="/config/rb-theme/rb_ie6.css" type="text/css"/> <![endif]-->

I have tried
a) CDATA with disable-output-escaping
The result is "<" and ">" are replace by &lt;   &gt;

b) <xsl:comment> ...  </xsl:comment>
The fragment is not showing up at all.

Any idea what I can do in order to have the above fragment appear in the
generated HTML.

Thanks in advance.

Regards.
Hoi Chong


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: CDATA and disable-output-escaping use in a theme file (xsl)

Hank Ratzesberger

Hoi,

Have you tried creating the element in xslt?

   <xsl:element name="link">
     <xsl:attribute name="href">/config.....</xsl:attribute>
     <xsl:attribute name="type">text/css</xsl:attribute>
   </xsl:element>

but I am not sure about placing this in a comment.
Comments are removed by the epilogue, so you would need
to modify it to pass any along.

Or are you testing for this using the request processor, which
lets you access the request headers, the browser type?

Regards,

--Hank

On Nov 3, 2008, at 9:42 AM, Hoi Chong wrote:

> Hi,
> I am creating a new theme to be use within Orbeon and I need to put  
> the following fragment into the HEAD section of the generated HTML  
> file...
>
> <!--[if lte IE 6]> <link rel="stylesheet" href="/config/rb-theme/
> rb_ie6.css" type="text/css"/> <![endif]-->
>
> I have tried
> a) CDATA with disable-output-escaping
> The result is "<" and ">" are replace by &lt;   &gt;
>
> b) <xsl:comment> ...  </xsl:comment>
> The fragment is not showing up at all.
>
> Any idea what I can do in order to have the above fragment appear  
> in the generated HTML.
>
> Thanks in advance.
>
> Regards.
> Hoi Chong
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: CDATA and disable-output-escaping use in a theme file (xsl)

Erik Bruchez
Administrator
In reply to this post by Hoi Chong
Tough one, I am not sure you can do it currently within a pipeline  
because

1. The XPL pipelines do not propagate comments properly.
2. disable-output-escaping is a serializer property, so it is lost  
along the pipeline as well.

#1 should be fixed some day in XPL. #2 could be possibly added to the  
oxf:xml-converter as well.

Does anybody have a creative way to achieve this?

-Erik

On Nov 3, 2008, at 9:42 AM, Hoi Chong wrote:

> Hi,
> I am creating a new theme to be use within Orbeon and I need to put  
> the following fragment into the HEAD section of the generated HTML  
> file...
>
> <!--[if lte IE 6]> <link rel="stylesheet" href="/config/rb-theme/
> rb_ie6.css" type="text/css"/> <![endif]-->
>
> I have tried
> a) CDATA with disable-output-escaping
> The result is "<" and ">" are replace by &lt;   &gt;
>
> b) <xsl:comment> ...  </xsl:comment>
> The fragment is not showing up at all.
>
> Any idea what I can do in order to have the above fragment appear in  
> the generated HTML.
>
> Thanks in advance.
>
> Regards.
> Hoi Chong
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: CDATA and disable-output-escaping use in a theme file (xsl)

Hoi Chong
In reply to this post by Hank Ratzesberger
Hank,
I need to use this funny code(s) in the generated HTML in order to
indicate a specific CSS that is meant for IE browsers to process.
Other browsers will ignore this code as it is treated as a comment.

<!--[if lte IE 6]>   ..........  <![endif]-->

By this way I can design a theme with different CSS to target different
browsers.

Thanks for the suggestion anyway.

Regards
Hoi Chong


Hank Ratzesberger wrote:

>
> Hoi,
>
> Have you tried creating the element in xslt?
>
>   <xsl:element name="link">
>     <xsl:attribute name="href">/config.....</xsl:attribute>
>     <xsl:attribute name="type">text/css</xsl:attribute>
>   </xsl:element>
>
> but I am not sure about placing this in a comment.
> Comments are removed by the epilogue, so you would need
> to modify it to pass any along.
>
> Or are you testing for this using the request processor, which
> lets you access the request headers, the browser type?
>
> Regards,
>
> --Hank
>
> On Nov 3, 2008, at 9:42 AM, Hoi Chong wrote:
>
>> Hi,
>> I am creating a new theme to be use within Orbeon and I need to put
>> the following fragment into the HEAD section of the generated HTML
>> file...
>>
>> <!--[if lte IE 6]> <link rel="stylesheet"
>> href="/config/rb-theme/rb_ie6.css" type="text/css"/> <![endif]-->
>>
>> I have tried
>> a) CDATA with disable-output-escaping
>> The result is "<" and ">" are replace by &lt;   &gt;
>>
>> b) <xsl:comment> ...  </xsl:comment>
>> The fragment is not showing up at all.
>>
>> Any idea what I can do in order to have the above fragment appear in
>> the generated HTML.
>>
>> Thanks in advance.
>>
>> Regards.
>> Hoi Chong
>>
>> --
>> You receive this message as a subscriber of the [hidden email]
>> mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>
> Hank Ratzesberger
> NEES@UCSB
> Institute for Crustal Studies,
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: CDATA and disable-output-escaping use in a theme file (xsl)

Hank Ratzesberger

Hi Hoi,

You can still create browser specific output on the server side by
evaluating the headers.

<p:processor name="oxf:request" xmlns:p="http://www.orbeon.com/oxf/ 
pipeline">
        <p:input name="config">
                <config>
                        <include>/request/headers</include>
                </config>
        </p:input>
        <p:output name="data" id="headers"/>
</p:processor>

And then in your xslt you can look for $headers/header[name='user-
agent']/value
and ouput the <link>, but sorry I can't stop to show a good example
of that today.

Not as simple as allowing some comments to pass through.

--Hank




On Nov 3, 2008, at 11:49 PM, Hoi Chong wrote:

> Hank,
> I need to use this funny code(s) in the generated HTML in order to  
> indicate a specific CSS that is meant for IE browsers to process.
> Other browsers will ignore this code as it is treated as a comment.
>
> <!--[if lte IE 6]>   ..........  <![endif]-->
>
> By this way I can design a theme with different CSS to target  
> different browsers.
>
> Thanks for the suggestion anyway.
>
> Regards
> Hoi Chong
>
>
> Hank Ratzesberger wrote:
>>
>> Hoi,
>>
>> Have you tried creating the element in xslt?
>>
>>   <xsl:element name="link">
>>     <xsl:attribute name="href">/config.....</xsl:attribute>
>>     <xsl:attribute name="type">text/css</xsl:attribute>
>>   </xsl:element>
>>
>> but I am not sure about placing this in a comment.
>> Comments are removed by the epilogue, so you would need
>> to modify it to pass any along.
>>
>> Or are you testing for this using the request processor, which
>> lets you access the request headers, the browser type?
>>
>> Regards,
>>
>> --Hank
>>
>> On Nov 3, 2008, at 9:42 AM, Hoi Chong wrote:
>>
>>> Hi,
>>> I am creating a new theme to be use within Orbeon and I need to  
>>> put the following fragment into the HEAD section of the generated  
>>> HTML file...
>>>
>>> <!--[if lte IE 6]> <link rel="stylesheet" href="/config/rb-theme/
>>> rb_ie6.css" type="text/css"/> <![endif]-->
>>>
>>> I have tried
>>> a) CDATA with disable-output-escaping
>>> The result is "<" and ">" are replace by &lt;   &gt;
>>>
>>> b) <xsl:comment> ...  </xsl:comment>
>>> The fragment is not showing up at all.
>>>
>>> Any idea what I can do in order to have the above fragment appear  
>>> in the generated HTML.
>>>
>>> Thanks in advance.
>>>
>>> Regards.
>>> Hoi Chong
>>>
>>> --
>>> You receive this message as a subscriber of the [hidden email]  
>>> mailing list.
>>> To unsubscribe: mailto:[hidden email]
>>> For general help: mailto:[hidden email]?subject=help
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: CDATA and disable-output-escaping use in a theme file (xsl)

Hoi Chong
Hi Hank,
Thanks for the suggestion. I have been looking into it and now encounter
a problem of getting to the XML output from a pipeline.
This is what I did:
a) Create a pipeline called "get-headers.xpl" and in it ...
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:sql="http://orbeon.org/oxf/xml/sql"
          xmlns:xs="http://www.w3.org/2001/XMLSchema"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:oxf="http://www.orbeon.com/oxf/processors">

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output"/>
   
    <p:processor name="oxf:request">
        <p:input name="config">
            <config>
                <include>/request/headers</include>
            </config>
        </p:input>
        <p:output name="data" ref="data"/>
    </p:processor>  
</p:config>


b) Using the "Welcome" app as an example to test the idea, I created a
"view.xsl"
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:f="http://orbeon.org/oxf/xml/formatting"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
    xmlns:version="java:org.orbeon.oxf.common.Version"
    xmlns="http://www.w3.org/1999/xhtml" >

    <!--
    <xsl:variable name="reqheaders" select="doc('input:instance')"
as="document-node()"/>
    -->
    <xsl:variable name="reqheaders"
select="string(doc('input:instance'))" as="xs:string"/>
    <!-- <xsl:variable name="header-user-agent"
select="$reqheaders/*/header[name='user-agent']/value" as="xs:string"/> -->

<xsl:template match="/">

    <html>
        <head>
            <title>Welcome to the Orbeon Forms Example Applications </title>
        </head>
        <body>
            <p>
                 Welcome to the Orbeon Forms example applications! Here
you will find several applications illustrating the
                 capabilities of Orbeon Forms. For more information
about Orbeon Forms, please visit the following
                 resources:
                 
                 &#60;!-- <xsl:value-of select="$reqheaders"/> --&#62;

            </p>
            <ul>
                <li>
                    <p>
                        <a href="/doc/" f:url-type="resource">Orbeon
Forms User Guide</a>
                    </p>
                </li>
                <li>
                    <p>
                        <a href="http://www.orbeon.com/">Orbeon Forms
Home Page</a>
                    </p>
                </li>
                <li>
                    <p>
                        <a
href="http://forge.objectweb.org/projects/ops/">Orbeon Forms at
ObjectWeb</a>
                    </p>
                </li>
            </ul>
        </body>
    </html>
</xsl:template>  
</xsl:stylesheet>


c) I modify "page-flow.xml" to be like this..
<config xmlns="http://www.orbeon.com/oxf/controller">

    <page path-info="/welcome/" view="view.xsl" model="get-headers.xpl"/>
   
    <!-- <page path-info="/welcome/" view="check-browser-version.xpl"/> -->

    <epilogue url="oxf:/config/epilogue.xpl"/>

</config>


Problems:
1) In view.xsl, we cannot get the XML content output by get-headers.xpl,
we tried using
<xsl:variable name="reqheaders" select="doc('input:instance')"
as="document-node()"/>
and this...
<xsl:variable name="reqheaders" select="doc('input:data')"
as="document-node()"/>
If I use the get-headers.xpl as a View, I can see all the headers info
with my browser.
I am sure that I am not using the right "select" to access the XML
output by get-headers.xpl,
what is the right select to use?


Hi Erik,
Just a suggestion,
I notice in the standard Orbeon "theme-examples.xsl" there are some
request parameters being exposed via
    <!-- This contains some useful request information -->
    <xsl:variable name="request" select="doc('input:request')"
as="document-node()"/>

Would be good to provide some headers info on the above
"doc('input:request')",  then developers can make use of this info
to detect browser being used, and help them to manage the CSS in order
to create themes that would work nicely on different browsers.

Thanks and regards.
Hoi



Hank Ratzesberger wrote:

>
> Hi Hoi,
>
> You can still create browser specific output on the server side by
> evaluating the headers.
>
> <p:processor name="oxf:request"
> xmlns:p="http://www.orbeon.com/oxf/pipeline">
>     <p:input name="config">
>         <config>
>             <include>/request/headers</include>
>         </config>
>     </p:input>
>     <p:output name="data" id="headers"/>
> </p:processor>
>
> And then in your xslt you can look for
> $headers/header[name='user-agent']/value
> and ouput the <link>, but sorry I can't stop to show a good example
> of that today.
>
> Not as simple as allowing some comments to pass through.
>
> --Hank
>
>
>
>
> On Nov 3, 2008, at 11:49 PM, Hoi Chong wrote:
>
>> Hank,
>> I need to use this funny code(s) in the generated HTML in order to
>> indicate a specific CSS that is meant for IE browsers to process.
>> Other browsers will ignore this code as it is treated as a comment.
>>
>> <!--[if lte IE 6]>   ..........  <![endif]-->
>>
>> By this way I can design a theme with different CSS to target
>> different browsers.
>>
>> Thanks for the suggestion anyway.
>>
>> Regards
>> Hoi Chong
>>
>>
>> Hank Ratzesberger wrote:
>>>
>>> Hoi,
>>>
>>> Have you tried creating the element in xslt?
>>>
>>>   <xsl:element name="link">
>>>     <xsl:attribute name="href">/config.....</xsl:attribute>
>>>     <xsl:attribute name="type">text/css</xsl:attribute>
>>>   </xsl:element>
>>>
>>> but I am not sure about placing this in a comment.
>>> Comments are removed by the epilogue, so you would need
>>> to modify it to pass any along.
>>>
>>> Or are you testing for this using the request processor, which
>>> lets you access the request headers, the browser type?
>>>
>>> Regards,
>>>
>>> --Hank
>>>
>>> On Nov 3, 2008, at 9:42 AM, Hoi Chong wrote:
>>>
>>>> Hi,
>>>> I am creating a new theme to be use within Orbeon and I need to put
>>>> the following fragment into the HEAD section of the generated HTML
>>>> file...
>>>>
>>>> <!--[if lte IE 6]> <link rel="stylesheet"
>>>> href="/config/rb-theme/rb_ie6.css" type="text/css"/> <![endif]-->
>>>>
>>>> I have tried
>>>> a) CDATA with disable-output-escaping
>>>> The result is "<" and ">" are replace by &lt;   &gt;
>>>>
>>>> b) <xsl:comment> ...  </xsl:comment>
>>>> The fragment is not showing up at all.
>>>>
>>>> Any idea what I can do in order to have the above fragment appear
>>>> in the generated HTML.
>>>>
>>>> Thanks in advance.
>>>>
>>>> Regards.
>>>> Hoi Chong
>>>>
>>>> --
>>>> You receive this message as a subscriber of the [hidden email]
>>>> mailing list.
>>>> To unsubscribe: mailto:[hidden email]
>>>> For general help: mailto:[hidden email]?subject=help
>>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>
>>> Hank Ratzesberger
>>> NEES@UCSB
>>> Institute for Crustal Studies,
>>> University of California, Santa Barbara
>>> 805-893-8042
>>>
>>>
>>>
>>>
>>>
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email]
>> mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>
> Hank Ratzesberger
> NEES@UCSB
> Institute for Crustal Studies,
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: CDATA and disable-output-escaping use in a theme file (xsl)

Hank Ratzesberger
Hi Hoi,


You are "on the right track," but there are a couple issues.

First, you nevertheless cannot insert comments, even in CDATA
sections, because they will still be removed by pipleline processing
when the html gets streamed.  Second, that you therefore need to
insert the <link> element directly, performing the include that the
browser did previously when it evaluated the directive in the comment.

<xsl:if test="matches($reqheaders/*/header[name='user-agent']/
value,'MSIE 6.0')>
   <link rel="stylesheet" href="/config/rb-theme/rb_ie6.css"  
type="text/css"/>
</xsl:if>

You may need to do more careful matching, but this should insert the  
stylesheet
link only when the browser (User Agent header) is IE 6.

Hope that helps,
Hank


On Nov 5, 2008, at 8:45 PM, Hoi Chong wrote:

> Hi Hank,
> Thanks for the suggestion. I have been looking into it and now  
> encounter a problem of getting to the XML output from a pipeline.
> This is what I did:
> a) Create a pipeline called "get-headers.xpl" and in it ...
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>          xmlns:sql="http://orbeon.org/oxf/xml/sql"
>          xmlns:xs="http://www.w3.org/2001/XMLSchema"
>          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>          xmlns:oxf="http://www.orbeon.com/oxf/processors">
>
>    <p:param name="instance" type="input"/>
>    <p:param name="data" type="output"/>
>      <p:processor name="oxf:request">
>        <p:input name="config">
>            <config>
>                <include>/request/headers</include>
>            </config>
>        </p:input>
>        <p:output name="data" ref="data"/>
>    </p:processor>  </p:config>
>
>
> b) Using the "Welcome" app as an example to test the idea, I  
> created a "view.xsl"
> <xsl:stylesheet version="2.0"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>    xmlns:f="http://orbeon.org/oxf/xml/formatting"
>    xmlns:xhtml="http://www.w3.org/1999/xhtml"
>    xmlns:xforms="http://www.w3.org/2002/xforms"
>    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>    xmlns:version="java:org.orbeon.oxf.common.Version"
>    xmlns="http://www.w3.org/1999/xhtml" >
>
>    <!--
>    <xsl:variable name="reqheaders" select="doc('input:instance')"  
> as="document-node()"/>
>    -->
>    <xsl:variable name="reqheaders" select="string(doc
> ('input:instance'))" as="xs:string"/>
>    <!-- <xsl:variable name="header-user-agent" select="$reqheaders/
> */header[name='user-agent']/value" as="xs:string"/> -->
>
> <xsl:template match="/">
>
>    <html>
>        <head>
>            <title>Welcome to the Orbeon Forms Example Applications  
> </title>
>        </head>
>        <body>
>            <p>
>                 Welcome to the Orbeon Forms example applications!  
> Here you will find several applications illustrating the
>                 capabilities of Orbeon Forms. For more information  
> about Orbeon Forms, please visit the following
>                 resources:
>                                 &#60;!-- <xsl:value-of  
> select="$reqheaders"/> --&#62;
>
>            </p>
>            <ul>
>                <li>
>                    <p>
>                        <a href="/doc/" f:url-type="resource">Orbeon  
> Forms User Guide</a>
>                    </p>
>                </li>
>                <li>
>                    <p>
>                        <a href="http://www.orbeon.com/">Orbeon  
> Forms Home Page</a>
>                    </p>
>                </li>
>                <li>
>                    <p>
>                        <a href="http://forge.objectweb.org/projects/ 
> ops/">Orbeon Forms at ObjectWeb</a>
>                    </p>
>                </li>
>            </ul>
>        </body>
>    </html>
> </xsl:template>  </xsl:stylesheet>
>
>
> c) I modify "page-flow.xml" to be like this..
> <config xmlns="http://www.orbeon.com/oxf/controller">
>
>    <page path-info="/welcome/" view="view.xsl" model="get-
> headers.xpl"/>
>      <!-- <page path-info="/welcome/" view="check-browser-
> version.xpl"/> -->
>
>    <epilogue url="oxf:/config/epilogue.xpl"/>
>
> </config>
>
>
> Problems:
> 1) In view.xsl, we cannot get the XML content output by get-
> headers.xpl, we tried using
> <xsl:variable name="reqheaders" select="doc('input:instance')"  
> as="document-node()"/>
> and this...
> <xsl:variable name="reqheaders" select="doc('input:data')"  
> as="document-node()"/>
> If I use the get-headers.xpl as a View, I can see all the headers  
> info with my browser.
> I am sure that I am not using the right "select" to access the XML  
> output by get-headers.xpl,
> what is the right select to use?
>
>
> Hi Erik,
> Just a suggestion,
> I notice in the standard Orbeon "theme-examples.xsl" there are some  
> request parameters being exposed via
>    <!-- This contains some useful request information -->
>    <xsl:variable name="request" select="doc('input:request')"  
> as="document-node()"/>
>
> Would be good to provide some headers info on the above "doc
> ('input:request')",  then developers can make use of this info
> to detect browser being used, and help them to manage the CSS in  
> order to create themes that would work nicely on different browsers.
>
> Thanks and regards.
> Hoi
>
>
>
> Hank Ratzesberger wrote:
>>
>> Hi Hoi,
>>
>> You can still create browser specific output on the server side by
>> evaluating the headers.
>>
>> <p:processor name="oxf:request" xmlns:p="http://www.orbeon.com/oxf/ 
>> pipeline">
>>     <p:input name="config">
>>         <config>
>>             <include>/request/headers</include>
>>         </config>
>>     </p:input>
>>     <p:output name="data" id="headers"/>
>> </p:processor>
>>
>> And then in your xslt you can look for $headers/header[name='user-
>> agent']/value
>> and ouput the <link>, but sorry I can't stop to show a good example
>> of that today.
>>
>> Not as simple as allowing some comments to pass through.
>>
>> --Hank
>>
>>
>>
>>
>> On Nov 3, 2008, at 11:49 PM, Hoi Chong wrote:
>>
>>> Hank,
>>> I need to use this funny code(s) in the generated HTML in order  
>>> to indicate a specific CSS that is meant for IE browsers to process.
>>> Other browsers will ignore this code as it is treated as a comment.
>>>
>>> <!--[if lte IE 6]>   ..........  <![endif]-->
>>>
>>> By this way I can design a theme with different CSS to target  
>>> different browsers.
>>>
>>> Thanks for the suggestion anyway.
>>>
>>> Regards
>>> Hoi Chong
>>>
>>>
>>> Hank Ratzesberger wrote:
>>>>
>>>> Hoi,
>>>>
>>>> Have you tried creating the element in xslt?
>>>>
>>>>   <xsl:element name="link">
>>>>     <xsl:attribute name="href">/config.....</xsl:attribute>
>>>>     <xsl:attribute name="type">text/css</xsl:attribute>
>>>>   </xsl:element>
>>>>
>>>> but I am not sure about placing this in a comment.
>>>> Comments are removed by the epilogue, so you would need
>>>> to modify it to pass any along.
>>>>
>>>> Or are you testing for this using the request processor, which
>>>> lets you access the request headers, the browser type?
>>>>
>>>> Regards,
>>>>
>>>> --Hank
>>>>
>>>> On Nov 3, 2008, at 9:42 AM, Hoi Chong wrote:
>>>>
>>>>> Hi,
>>>>> I am creating a new theme to be use within Orbeon and I need to  
>>>>> put the following fragment into the HEAD section of the  
>>>>> generated HTML file...
>>>>>
>>>>> <!--[if lte IE 6]> <link rel="stylesheet" href="/config/rb-
>>>>> theme/rb_ie6.css" type="text/css"/> <![endif]-->
>>>>>
>>>>> I have tried
>>>>> a) CDATA with disable-output-escaping
>>>>> The result is "<" and ">" are replace by &lt;   &gt;
>>>>>
>>>>> b) <xsl:comment> ...  </xsl:comment>
>>>>> The fragment is not showing up at all.
>>>>>
>>>>> Any idea what I can do in order to have the above fragment  
>>>>> appear in the generated HTML.
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Regards.
>>>>> Hoi Chong
>>>>>
>>>>> --
>>>>> You receive this message as a subscriber of the ops-
>>>>> [hidden email] mailing list.
>>>>> To unsubscribe: mailto:[hidden email]
>>>>> For general help: mailto:[hidden email]?subject=help
>>>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>>
>>>> Hank Ratzesberger
>>>> NEES@UCSB
>>>> Institute for Crustal Studies,
>>>> University of California, Santa Barbara
>>>> 805-893-8042
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> You receive this message as a subscriber of the [hidden email]  
>>> mailing list.
>>> To unsubscribe: mailto:[hidden email]
>>> For general help: mailto:[hidden email]?subject=help
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: CDATA and disable-output-escaping use in a theme file (xsl)

Erik Bruchez
Administrator
In reply to this post by Hoi Chong
> I need to use this funny code(s) in the generated HTML in order to  
> indicate a specific CSS that is meant for IE browsers to process.
> Other browsers will ignore this code as it is treated as a comment.

BTW there are other ways to target specific CSS for IE. In particular,  
you can, like YUI does, prefix property names with a "*", e.g.:

   .foobar { *font-size: 100% } /* this will work only with IE */

This leverage CSS parsing bugs in IE, and it is a fairly common  
method. If you just have a few special CSS rules for IE, this works  
quite well.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: CDATA and disable-output-escaping use in a theme file (xsl)

Hoi Chong
In reply to this post by Hank Ratzesberger
Hi Hank,
Thanks for the help, I've got it working.

Erik,
Thanks for the quick tip on an IE css processing quirks.




Hank Ratzesberger wrote:

> Hi Hoi,
>
>
> You are "on the right track," but there are a couple issues.
>
> First, you nevertheless cannot insert comments, even in CDATA
> sections, because they will still be removed by pipleline processing
> when the html gets streamed.  Second, that you therefore need to
> insert the <link> element directly, performing the include that the
> browser did previously when it evaluated the directive in the comment.
>
> <xsl:if
> test="matches($reqheaders/*/header[name='user-agent']/value,'MSIE 6.0')>
>   <link rel="stylesheet" href="/config/rb-theme/rb_ie6.css"
> type="text/css"/>
> </xsl:if>
>
> You may need to do more careful matching, but this should insert the
> stylesheet
> link only when the browser (User Agent header) is IE 6.
>
> Hope that helps,
> Hank
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws