cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <rica...@apache.org>
Subject Re: XML markup stored as text data
Date Tue, 09 May 2000 15:25:17 GMT
On Tue, 09 May 2000, Darren Scott wrote:
> I have a question about using stored XML markup. Say I have an XSP page
> which retrieves some text from an SQL table using JDBC. I want to
> include some XML markup in that textual data, an I want to be able to
> process it with the XSL stylesheet.
> 
> Is this going to be possible? I guess the question is, can I turn a JDBC
> string into DOM fragment and append it to the source tree for XSL
> processing?

You can use "util:include-expr" to parse any expression and append it
to the current XSP document position. Example:

  <xsp:page ...>
    . . .
    <util:include-expr>
      <util:expr>
        resultSet.getString("column_name")
      </util:expr>
    </util:include-expr>
    . . .
  </xsp:page>

This tag is available with the latest release (1.7.4) only.

For previous versions you can use <xsp:expr> and  the XSP built-in
parser. Example:

  <xsp:page ...>
    . . .
    <util:include-expr>
      <xsp:expr>
        this.xspParser.parse(
          new InputSource(
            new StringReader(
  	    resultSet.getString("column_name")
            )
          )
        ).getDocumentElement()
      </xsp:expr>
    </util:include-expr>
    . . .
  </xsp:page>


Mime
View raw message