cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Re: REPOST: HTML Tags from a database field
Date Mon, 14 Jan 2008 05:57:01 GMT
That could be the issue - the database field may *contain* XML tags
but does not necessarily *start* with one.  Maybe I could wrap the
whole field in a "<div>" tag before posting it, although that seems a 
little clumsy - I agree it would be easier to specifically request a field
as XML, with the option to add a wrapper, at request time.
Any chance this approach can be "patched" as part of the 2.1.x series?

>>> Grzegorz Kossakowski <> 2008/01/13 02:06 AM >>>
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
        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 {
                    } catch (Exception ignored) {
                        // FIXME: bad coding "catch(Exception)"
                        // If an exception occured the data was not (valid) xml
                } else {

As you see, SQLTransformer checks for possibility that it got an XML as value. The check is
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
handle some columns as a serialized XML content that needs parsing...

Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon 

To unsubscribe, e-mail: 
For additional commands, e-mail: 

This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice,
and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

View raw message