cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Stenhouse" <extconsultant.alan.stenho...@wireless-vision.de>
Subject get-xml and embedded tags in DB fld solution
Date Wed, 31 Jan 2001 12:41:04 GMT
Hi there

Just passing on our solution for getting data from a DB which contains
embedded tags.

We do (accessing a mySQL DB) something like:

<esql:execute-query>
	<esql:use-connection>default</esql:use-connection>
	<esql:query>select
concat('&lt;ggg&gt;',myFldWithTags,'&lt;/ggg&gt;') as D2 from myTable
where my_ID=34;
	</esql:query>
	<esql:results>
		<p><esql:get-xml column="D2"/></p>
	</esql:results>
</esql:execute-query>


The main thing that is happening here is that we're surrounding the
particular field with a set of tags, so that the resulting output will
be a well-formed branch. It doesn't seem to matter what exactly the tags
are, hence the nonsensical ones (<ggg> and </ggg>) above.

NOTE that for the embedded tags to be processed correctly you'll
probably need an entry for them in your XSL sheet.

HTH

Alan

Mime
View raw message