XSLT document() and URL Rewriting via custom 404 error

  • Thread starter Greg Collins [Microsoft MVP]
  • Start date
G

Greg Collins [Microsoft MVP]

I have a site that uses a custom 404 error page to perform URL Rewriting. This works excellent for all my needs except for one area.

When transforming XML, I have some XSLT code that uses the document() function to load some dynamic XML from a SQL database via an ASP.NET page. I am able to get this to work by calling the rewritten URL via an HTTP call--for example: document('http://site/fakefile.xml"). For a while now I have been trying to figure out how to get the XSL transform function document() to load a file via the URL Rewriting so I don't have to make an HTTP call for it.

Any ideas?

On a side note, loading this redirected XML via an HTTP call causes the page to show up in the logs differently than if I had an actual file that I was loading--for example: document('/folder/actualfile.xml'). I don't know the correct terminology, but there appears to be a primary visit that gets recorded, and then all the sub-calls from that page (i.e. loading images, etc), which are logged differently. These sub calls don't show up in my server stats pages, while the primary visits do. Not sure if what I'm trying to do will make a difference in this.
 
C

Cowboy \(Gregory A. Beamer\)

You can put the XML and xsl into streams and then you can convert them to
whatever you wish, like a string. I did this on my first book. Although it
is 1.0, you should be able to alter the idea. THe download is the book
ADO.NET and XML:ASP.NET on the Edge and is found at
http://www.wiley.com/extras. The chapters in question are the final
chapters.

I am sure it will not solve the entire problem, but it should give you some
ideas.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_com> wrote in message
I have a site that uses a custom 404 error page to perform URL Rewriting.
This works excellent for all my needs except for one area.

When transforming XML, I have some XSLT code that uses the document()
function to load some dynamic XML from a SQL database via an ASP.NET page. I
am able to get this to work by calling the rewritten URL via an HTTP
call--for example: document('http://site/fakefile.xml"). For a while now I
have been trying to figure out how to get the XSL transform function
document() to load a file via the URL Rewriting so I don't have to make an
HTTP call for it.

Any ideas?

On a side note, loading this redirected XML via an HTTP call causes the page
to show up in the logs differently than if I had an actual file that I was
loading--for example: document('/folder/actualfile.xml'). I don't know the
correct terminology, but there appears to be a primary visit that gets
recorded, and then all the sub-calls from that page (i.e. loading images,
etc), which are logged differently. These sub calls don't show up in my
server stats pages, while the primary visits do. Not sure if what I'm trying
to do will make a difference in this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top