469,361 Members | 2,239 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,361 developers. It's quick & easy.

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.

Thanks!
Dec 10 '07 #1
1 2885
jkmyoung
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)
http://www.w3.org/TR/xslt20/#element-result-document

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
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.