|
From: Sherman W. <sw...@ga...> - 2003-05-14 01:30:40
|
I am working with Ken Geis on getting BabelDoc up and running in our
product.
As we are going through understanding BDoc, and seeing how we can use
it, I am stuck on something which seems like it should be a standard
thing to do.
We have XML documents running through the pipelines, and have a need to
include the results of a SQL query back into the XML itself. For
example, we have the name of an item:
<ITEM>
<NAME>An item name</NAME>
</ITEM>
We have a static data table that relates an item name to a code:
CODE table
ID | CODE | NAME |
1 | 25 | An item name |
We need to execute:
Select code from Code where name = $name
We need the result:
<ITEM>
<CODE>25</CODE>
<NAME>An item name</NAME>
</ITEM>
The xslt-velocity-sql example in BDoc 1.0 RC5 sort of looks like the way
to go, but:
- VariableProcessor.executeSqlSelect has been moved to
VelocitySqlContext and seems incomplete (initialize is not called
anywhere)
- I think I want to embed the SQL in the XSL, not in the
underlying document. The example has the SQL in the document.
I know about SqlEnrich, but I need the data in the document itself for
downstream processing, not in the BabelDoc attributes.
Does anyone in BabelDoc land have any advice?
Thanks!
Sherman Wood
GalenWorks LLC
415 516-4894
|