[thelist] XML/XSLT & ASP question

Jason Lustig lustig at buffalo.edu
Sun Nov 10 23:52:02 CST 2002


Hey everyone! I'm working on a project where I need to use XML and XSLT
with the MSXML com objects that are within IIS.

Basically, I want to be able to have someone type up the xml file, and
then #include a file that will perform the transformation with the MSXML
objects. So this is how I would have it set up...

<?xml version="1.0"?>
<content>
html content goes here
html content goes here
html content goes here
html content goes here
</content>

<!--#include file="transform.asp"-->


... and transform.asp would do the transformation. However, I need to
get the xml string in order to do the transformation. So what I thought
about was doing output buffering, putting this code at the top of the
file:

<%
response.buffer = true
%>

... and then in transform.asp, I would put code to pull what is in the
buffer, clear it, and then do the transformation on the xml string that
i pulled from the buffer. From my experience with php, I would do it
like this:

<?php
$str = ob_get_contents();
ob_clean();
// code to transform $str
?>

... however, in ASP, I can't seem to find a method within the Response
object that is the equivelant of ob_get_contents(). If there is one, it
would make everything easy, because then I can just take that output and
put it through my xslt files.

Is there such a function? If there isn't, is there any way to go about
this kind of setup so that I can get the string of the xml, without
having to simply append the text to this string whenever I would rather
have done a response.write or had text outside of the <% and %> ?

I'm trying to find a way to get this to work, and I've been searching
for hours... thanks in advance!

--Jason




More information about the thelist mailing list