[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Output ASP code tags "<% %>" via  Microsoft.XMLDOM.transformNodetoObject

Asked by guadalupe in Active Server Pages (ASP), Extensible HTML (XHTML)

Tags: transformnodetoobject, xmlhtml

Hi,

I am try to use XML/XSL to generate ASP pages.  I already have code which works for normal HTML:


set xmlHTML     = Server.CreateObject("Microsoft.XMLDOM")
set xslDoc     = Server.CreateObject("Microsoft.XMLDOM")
set xmlDoc     = Server.CreateObject("Microsoft.XMLDOM")

xmlDoc.load(Server.Mappath(xml))
xslDoc.load(Server.Mappath(xsl))

xmlDoc.transformNodetoObject xslDoc, xmlHTML 'Create procesed HTML file
xmlHTML.save(Server.Mappath("out.html"))

This code is being used to impliment a back office content editor and avoid a DB as the the stucture is too non-regular. This way I can generate static HTML and avoid the mergeing of XML/XSL for each request. (yes thera are ways to do all this and use a DB, but I prefer this).  

My problem is that some pages need to include ASP pages as they are dynamic at "run time" providing searches and orders linked to a product database.  The dificulty is in getting transformNodetoObject to correctly output "<% %>" tags.  I gave tried CDATA sections both within the XSL or as the text of a XML node to be inserted at some plase in the XSL, and also using

<xsl:text disable-output-escaping="yes">&lt;%</xsl:text>, and even trying to be

inventive as in:

<xsl:value-of disable-output-escaping="yes" select="&gt;"/>

And both the alternatives with literal "<%"  but all to no avail.  My only results are to produce a file with html encoded lt and gt or an "Unknown error"  upon running the code, obviously due to attempted transformation for the "tag".

Can anyone help? Below are examples of my XML and XSL.  I have tried working with other names spaces and even investigated the MSXML name space but found nothing to help.

THANKS!!!!


<?xml version="1.0"?>

<xsl:stylesheet
   xmlns:xsl="http://www.w3.org/TR/WD-xsl"
   xmlns="http://www.w3.org/1999/XSL/Transform"
   result-ns="">
     <!-- <xsl:output method="html" cdata-section-elements=""/> -->

     <!-- Root template -->
     <xsl:template match="/">
          <html>
          <head>
          <title>TEST 2</title>
          </head>

          <body>
          <xsl:apply-templates select="/page/*"/>

          <!-- <xsl:value-of disable-output-escaping="yes" select="/page/aspOpen/text()"/> -->          
          <!-- <xsl:value-of disable-output-escaping="yes" select="&gt;"/> -->
          <!-- <xsl:text> <![CDATA[<% Response.Write("Hello From ASP") %>]] </xsl:text> -->
          <!-- <xsl:comment>// <![CDATA[<% ]]> Response.Write("Hello From ASP") <![CDATA[ %>]]> \\</xsl:comment> -->
         
          </body>
          </html>
     </xsl:template>
         
     <xsl:template match="*">
          <xsl:value-of select="."/>
     </xsl:template>

</xsl:stylesheet>



<?xml version="1.0"?>
<page>
     <textarea1 id="menuItem1" rows="30" cols="30">Big long textarea</textarea1>
     <text id="title">TextBox</text>
     <aspOpen><![CDATA[<%]]></aspOpen>
     <aspClose><![CDATA[&gt;%]]></aspClose>
</page>
 
Related Solutions
 
Loading Advertisement...
 
[+][-]04/24/03 11:53 AM, ID: 8390504Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/24/03 12:39 PM, ID: 8390838Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/24/03 01:36 PM, ID: 8391121Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/24/03 02:09 PM, ID: 8391278Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/24/03 02:20 PM, ID: 8391330Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/24/03 02:46 PM, ID: 8391482Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Active Server Pages (ASP), Extensible HTML (XHTML)
Tags: transformnodetoobject, xmlhtml
Sign Up Now!
Solution Provided By: ASPGuru
Participating Experts: 3
Solution Grade: A
 
[+][-]05/03/03 11:38 PM, ID: 8453579Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/17/03 11:59 PM, ID: 9575756Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/29/04 01:44 PM, ID: 11188648Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/03/04 03:45 AM, ID: 11220892Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89