Hello,

I've been working nog with the taglibs for sometime and i want to know
if there could be an additional tag or attribute, in with wich i can say
that the output of the writers should be in an certain format.
Now you have to use the html(field) and gui(field) everywhere.

Situation:
        We have a node with a field named "foo", with value '<none>'.
        This is the value want to be in this field, and is not related
        to html/xml. But when this value is displayed on a page, the
        value will dissapear since it is interperted as an tag.
        

Example of how it now works:
        Escaped:
        <h1><mm:field name="gui(foo)" /></h1>
        or 
        <h1>
                <mm:formatter format="escapexml">
                        <mm:field name="foo" />
                </mm:formatter>
        </h1>

        Value not escaped:
        <mm:field name="foo" /> 

Proposal #1:
        Escaped:
        <mm:output escape="html">
                <h1><mm:field name="foo" /></h1>
        </mm:output>
        The writer tag sees that it is in an output tag, and calls the
        output tag with it's information. This output tag will return
        the converted value, after which the field writes itselve to the        page.

        Value not escaped:
        <mm:field name="foo" /> 

Proposal #2:
        Escaped:
        <h1><mm:field name="foo" /></h1>

        Value not escaped:
        <mm:field name="foo" escape="false"/>

        Since taglibs can only be used inside jsp page's, the default
        behaviour of the field could be to escape all the information it
        outputs.
        An additional attribute can be used to override this behaviour.
        IICR default behaviour for a missing attribute can be defined
        for an attribute, making it backwards compatible (then the
        default behaviour would be escape="false" and you would need to
        use an escape="true" to output it in html)

My personal view is that everything should be escaped by default, unless
otherwise specified in the page.
My reason is that you want html format output most of the time and also
cross-side scripting becomes very difficult.If you want to output it in
another format, you should put output tags around it.
This is a combination of both proposals, but it aint no longer backwards
compatible.

Proposal #3:
        Escaped:
        <h1><mm:field name="foo" /></h1>

        Value not escaped:      
        <mm:output escape="plain">
                <mm:field name="foo" />
        </mm:output>

Are there more people who ran into this problem, and what are their
thoughts about this -problem-?

-- 
Eduard Witteveen Systeem Ontwikkelaar
NOS Internet,  Gateway C Kamer 107
+31(0)356772910 http://www.omroep.nl/

Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal

Reply via email to