Hi Robby,
Am 14.04.11 13:43, schrieb Robby Pelssers:
Hi all,
i've got an interesting use case where my starting point is XML data (could be
1 single file, aggregated xml data, xquery results, ...)
From this input I have to generate a DITA map and topics for which I have a
map.dtd and topic.dtd which I can use for validation purposes.
At some point in time during all transformation steps I have something like
below simplified snippet immediately before I want to use the source-writing
transformer. I need to validate the map and topics before writing the files to
disc.
<Root>
<map>...</map>
<topic>...</topic>
<topic>...</topic>
...
</Root>
I can't simply use the approach below
<map:transform src="schemas/topic.xsd" type="validate"/> (similar for map)
since I still have an aggregated situation.
Did anyone ever have a similar situation and a solution for this?
Ideally the org.apache.cocoon.transformation.ValidatingTransformer could handle
an optional xpath expression to specify which nodes to treat as rootnodes for
validation.
Would this approach work?
yes, I assume that this approach would work.
A relatively simple alternative would be to modularize the page
generation. The drawback is probably a decreased performance, especially
when generating the initial XML is expensive.
1. Transform the initial XML data into an XML structure containing
include tags for the single fragments which need to be validated (map,
topic etc.)
2. The include transformation calls a separate pipeline for each
fragment type; these pipelines contain the validation transformation
step. Unfortunately, the initial XML needs to be re-generated in each of
these calls.
Maybe this works for you?
Best regards,
Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]