cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <gkossakow...@apache.org>
Subject Re: REPOST: HTML Tags from a database field
Date Sun, 13 Jan 2008 00:06:45 GMT
Derek Hohls pisze:
> Tobia
>  
> Whew!  Sounds like a lot of work for what I thought would be a
> simple config issue.   Any chance you could make the stylesheets
> available - maybe upload them to the wiki?

I just looked at the code of SQLTransformer and found this, which is rather interesting to
you:
        protected void serializeData(String value)
        throws SQLException, SAXException {
            if (value != null) {
                value = value.trim();
                // Could this be XML ?
                if (value.length() > 0 && value.charAt(0) == '<') {
                    try {
                        stream(value);
                    } catch (Exception ignored) {
                        // FIXME: bad coding "catch(Exception)"
                        // If an exception occured the data was not (valid) xml
                        data(value);
                    }
                } else {
                    data(value);
                }
            }
        }

As you see, SQLTransformer checks for possibility that it got an XML as value. The check is
quite
silly but should work. The question is: does the XML stored in a database starts with "<"
as a first
character or something else?

BTW. I'm quite surprised that it seems there is no way to explicitly tell the SQLTransformer
to
handle some columns as a serialized XML content that needs parsing...

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message