This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

JScript extension function, which takes a result tree and serializes it?


Dear List,

I thought this should be a FAQ and i was surprised when found no information
on this issue. No samples, no explanations... Did i overlook something?

I would like to produce multiple output files during one transformation with
MSXML (I know, it is relatively easy to accomplish with other XSLT
prrocessors, but i have to do it with the one from Microsoft). Simplified
algorithm i'm going to use is as follows:


<msxsl:script language="JScript" implements-prefix="user">

	function saveToFile(data, outputFile) {
		// serialize, if needed, and
		// save to file here
		return("");
	}

</msxsl:script>

<xsl:template name="prepareDataForOneFile">

	<xsl:variable name="dataChunk">
	<!-- XSLT processing here -->
	</xsl:variable>

	<xsl:value-of select="user:saveToFile($dataChunk, $fileName)"/>
</xsl:template>


My question is how to treat, i.e. proccess, $dataChunk passed from a
template to an extension function? I guess, if $dataChunk contains pure XML,
then extension function receives a nodeset and the best way to process it is
just cycling through the nodes.

But wat happens, then the template returns, i.e. $dataChunk contains, HTML
or raw RTF code? I mean, what type of object will i get in this case in
function parameter - string, nodes, ...? How to access the parameter data to
save it to file? Sorry, it must be something obvious, but i'm stuck.

Any ideas, suggestions, comments and links on the topic are very much
appreciated.


p.s. Many thanks to all, answered my previous question: "xsl:sort - sorting
outline numbered values". Special thanks to David Carlisle and Francis
Norton.

Regards,
Ilya


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]