Quietening Tidy on HTML pages in a JSP app

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

Quietening Tidy on HTML pages in a JSP app

Chris Bailey-2
Hi.
I am running a JSP site and using Orbeon on a selected number of pages.
I have set up ops-main-filter to apply to all pages but I only use the forms on pages with contentType="application/xhtml+xml". All my other pages are still parsed by orbeon and run through Tidy.

What i would like to do is run tidy with the quiet option. Where can I configure this?

Thanks,
Chris.



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Quietening Tidy on HTML pages in a JSP app

Hank Ratzesberger

To work around a similar problem, I altered
ProcessorUtils, changing the following,
(adding the HTML_CONTENT_TYPE)

    public static boolean isXMLContentType(String contentType) {
        if (contentType == null)
            return false;
        return contentType.equals(XML_CONTENT_TYPE1)
                || contentType.equals(XML_CONTENT_TYPE2)
                || contentType.endsWith(XML_CONTENT_TYPE3_SUFFIX)
                || contentType.endsWith(HTML_CONTENT_TYPE);
    }

This would effectively disable tidy which is only
called to insure html is well formatted.  If your
pages are not xhtml compatible, then your pipeline would
have other errors.

--Hank

Hank Ratzesberger
Institute for Crustal Studies


----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, February 14, 2007 6:05 AM
Subject: [ops-users] Quietening Tidy on HTML pages in a JSP app


> Hi.
> I am running a JSP site and using Orbeon on a selected number of pages.
> I have set up ops-main-filter to apply to all pages but I only use the forms on pages with contentType="application/xhtml+xml".
> All my other pages are still parsed by orbeon and run through Tidy.
>
> What i would like to do is run tidy with the quiet option. Where can I configure this?
>
> Thanks,
> Chris.
>
>

--------------------------------------------------------------------------------


>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Quietening Tidy on HTML pages in a JSP app

Chris Bailey-2
Thanks Hank. It looks like that will work.

I notice looking at the code that I could also just set all my pages to be
contentType="text/xml" - not sure what the impact of this would be as when
I make this change the resulting pages sill have <meta
http-equiv="Content-Type" content="text/html; charset=utf-8"> added to them.

However I would really like a simple option in something like
properties.xml that would run TIDY with a quiet option (or disable it
altogether) rather then having to either recompile or changing the
content-type declarations.

Thanks again!

Chris.

--On 14 February 2007 11:17 -0800 Hank Ratzesberger
<[hidden email]> wrote:

>
> To work around a similar problem, I altered
> ProcessorUtils, changing the following,
> (adding the HTML_CONTENT_TYPE)
>
>     public static boolean isXMLContentType(String contentType) {
>         if (contentType == null)
>             return false;
>         return contentType.equals(XML_CONTENT_TYPE1)
>                 || contentType.equals(XML_CONTENT_TYPE2)
>                 || contentType.endsWith(XML_CONTENT_TYPE3_SUFFIX)
>                 || contentType.endsWith(HTML_CONTENT_TYPE);
>     }
>
> This would effectively disable tidy which is only
> called to insure html is well formatted.  If your
> pages are not xhtml compatible, then your pipeline would
> have other errors.
>
> --Hank
>
> Hank Ratzesberger
> Institute for Crustal Studies
>
>
> ----- Original Message ----- From: <[hidden email]>
> To: <[hidden email]>
> Sent: Wednesday, February 14, 2007 6:05 AM
> Subject: [ops-users] Quietening Tidy on HTML pages in a JSP app
>
>
>> Hi.
>> I am running a JSP site and using Orbeon on a selected number of pages.
>> I have set up ops-main-filter to apply to all pages but I only use the
>> forms on pages with contentType="application/xhtml+xml".  All my other
>> pages are still parsed by orbeon and run through Tidy.
>>
>> What i would like to do is run tidy with the quiet option. Where can I
>> configure this?
>>
>> Thanks,
>> Chris.
>>
>>
>
>
> -------------------------------------------------------------------------
> -------
>
>
>>
>> --
>> 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
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>
>
>


--
----------------------
Chris Bailey
[hidden email]



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Quietening Tidy on HTML pages in a JSP app

Erik Bruchez
Administrator
In reply to this post by Chris Bailey-2
Chris,

> I am running a JSP site and using Orbeon on a selected number of pages.
> I have set up ops-main-filter to apply to all pages but I only use the forms on pages with contentType="application/xhtml+xml". All my other pages are still parsed by orbeon and run through Tidy.
>
> What i would like to do is run tidy with the quiet option. Where can I configure this?

It may be that oxf:servlet-filter-generator (ServletFilterGenerator)
instanciates Tidy without explicitly passing the "quiet" option.
Ideally, that processor would allow some Tidy options, but it doesn't at
the moment. If you build Orbeon Forms from source, you can probably look
at the following lines in StreamInterceptor.java:

Tidy tidy = new Tidy();
if (tidyConfig != null) {
     tidy.setShowWarnings(tidyConfig.isShowWarnings());
     tidy.setQuiet(tidyConfig.isQuiet());
     if (tidyConfig.isQuiet())
         tidy.setErrout(new PrintWriter(new StringWriter()));
}

and change this to set isQuiet(false) if tidyConfig is null.

-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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws