471,886 Members | 1,109 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,886 software developers and data experts.

Get Current Document in XSLT

What I'm doing is that I have some automation pieces set up that take a flat .txt file, applies an xsd to this to turn it into a flat XML file, and I then apply an XSLT to this flat XML file to turn it into an XML document that adheres to our internal standards. So, my question is
this: Is there any way that while in the XSLT I can get a "snapshot" of the currently transformed document? I want to be able to look at it after I'm done processing and run some statistics to see if any records from the original flat XML file were left out, etc. I have some conditionals inside of my XSLT, so I know that there will be instances where not all records from the original document will be translated, and I'd like to figure out which ones.

Dec 10 '07 #1
1 2997
2,057 Expert 2GB
When you say take a snapshot do you mean:
1. Create a seperate output file?
You can use <xsl:result-document href="newfile.xml"> to do so, (XSLT 2.0)

If constrained to XSLT 1.0, this is processor dependent, eg.
<saxon:output href="newfile.xml">

2. Create a copy of the xml inside your result? Not sure if it would conform to your company standards, but you could add somewhere in your xslt:
<xsl:copy-of select="/"/> <!-- copy entire file into result -->

Or do you mean something else altogether?
Dec 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Asbjørn Ulsberg | last post: by
4 posts views Thread by Cathie | last post: by
17 posts views Thread by rox.scott | last post: by
4 posts views Thread by Steven Davies | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.