[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] redirecting ouput to a different file?


Subject: [xsl] redirecting ouput to a different file?
From: dvint@xxxxxxxxx
Date: Thu, 18 Aug 2011 14:16:15 -0700

I'm working in v2.0. I'm thinking that <xsl:result-document> might be the
solution, but I haven't fully absorbed the implications or process. So
here is the probelm.

I have an input document that has a name like
DMC-GAASIB0-01-32-00-00-00000-051A-B_000-00.xml. In that document is a
bunch of tags that have the data that makeup this name:

            <avee>
               <modelic>GAASIB0</modelic>
               <sdc>01</sdc>
               <chapnum>32</chapnum>
               <section>0</section>
               <subsect>0</subsect>
               <subject>00</subject>
               <discode>00</discode>
               <discodev>000</discodev>
               <incode>051</incode>
               <incodev>A</incodev>
               <itemloc>B</itemloc>
            </avee>

I'm writing a stylesheet that will process a bunch of files similar to
this one. My goal is to map these DMCs (data module codes) that make up
the file name, the meta data in the document, and cross references to
other documents. I have a separate map file that will contain the before
and after values and I can change the values in the content.

Using Kernow I can easily run this stylesheet against a directory and it
will recreate the same filename with the changed content. That gets me
halfway there.

The question here is, can I read file of one name and output all this
result to a new file name based upon the values in the mapping file?

I'm thinking that I have to write all the content to a variable as a
nodeset (not create any output), then send that nodeset content via
xsl:result-document to the new file name.

Am I going in the right direction or is there something else I should
consider?

..dan


Current Thread