This is an interesting sort of problem. Will your "metadata" output be
further machine processed to prove the transformation integrity, or just
human inspected?
Years ago when I was asked to verify my transform was correct, I wrote
out a schematron result-document with rules stating what the output
should look like. Then I ran the schematron rules against the XSLT
output. In your case, you could tell schematron to report not only what
was expected, but why.
I probably used different modes, as Martin originally suggested. As
Wendell points out, this is a bit removed from the actual logic of the
templates.
Regards,
--Paul
On 6/28/24 17:14, Wendell Piez wapiez@xxxxxxxxxxxxxxx wrote:
> Roger,
>
> Yes, what Martin said.
>
> If you don't like separate modes because you want your tracing logic
> coupled closely to your transformation logic, the classic 'XSLT
> approach' would be to build a unified tree in one pass, then
> post-process that tree twice, once for main outputs (filtering out the
> logs) and a separate time for the trace log (filtering everything else).
>
> Indeed you might find with the second pass to extract the trace log,
> you can also enhance it usefully.
>
> More generally, to make XSLT work you need to adopt a 'pipelining'
> mentality, by which I mean an idea of separate discrete steps
> achieving discrete aims, working in combination - for example in this
> case, generating the logged information is actually separate from
> writing it to a file.
>
> Good luck, Wendell
>
>
>
> On Fri, Jun 28, 2024 at 5:44b/PM Martin Honnen martin.honnen@xxxxxx
> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>
> On 28/06/2024 23:39, Roger L Costello costello@xxxxxxxxx wrote:
>> Is there anyway that I can achieve what I desire -- output to one
>> document the result of mapping the old form to the new form and output
>> to another document metadata that describes the mapping steps that were
>> taken? Or is this outside the realm of XSLT's capabilities?
>
>
> I would consider processing the nodes/elements twice in different
> modes where one mode creates the primary result and the other one
> the xsl:result-document.
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe
> <http://lists.mulberrytech.com/unsub/xsl-list/174322> (by email)
>
>
>
> --
> ...Wendell Piez... ...wendell -at- nist -dot- gov...
> ...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
> ...github.com/wendellpiez. <http://github.com/wendellpiez.>..
> ...gitlab.coko.foundation/wendell...
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/1043515>
> (by email <>)
|