XML MessageBoard
-
Hello, I am Andrea from Italy. ToDay I have download this script http://www.codeproject.com/asp/xml\_messageboard.asp and I have trouble. I f I place html code in this page before the asp script, it return with strange simbol: <%@ Language=VBScript %> <% ' View Message ' prevent page caching Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 xslpath = Server.mappath("viewmessage.xsl") '"d:\InetPub\wwwroot\XMLmessageboard\messageboard.xsl" xmlpath = Application("xmlpath") Set id = Request.QueryString("id") set xdoc = Application("xdoc") set xsldoc = Server.CreateObject("MSXML2.FreeThreadedDOMDocument") 'load up XSL doc and perform transformations xsldoc.async = false xsldoc.load(xslpath) set xsltemp = Server.createObject("MSXML2.XSLTemplate") xsltemp.stylesheet=xsldoc set xslproc = xsltemp.createProcessor xslproc.input=xdoc.nodeFromID(id) xslproc.output=Response ' parameter for message group xslproc.addParameter "msgid",CStr(id) xslproc.transform() %> why ? Thanks, Andrea
-
Hello, I am Andrea from Italy. ToDay I have download this script http://www.codeproject.com/asp/xml\_messageboard.asp and I have trouble. I f I place html code in this page before the asp script, it return with strange simbol: <%@ Language=VBScript %> <% ' View Message ' prevent page caching Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 xslpath = Server.mappath("viewmessage.xsl") '"d:\InetPub\wwwroot\XMLmessageboard\messageboard.xsl" xmlpath = Application("xmlpath") Set id = Request.QueryString("id") set xdoc = Application("xdoc") set xsldoc = Server.CreateObject("MSXML2.FreeThreadedDOMDocument") 'load up XSL doc and perform transformations xsldoc.async = false xsldoc.load(xslpath) set xsltemp = Server.createObject("MSXML2.XSLTemplate") xsltemp.stylesheet=xsldoc set xslproc = xsltemp.createProcessor xslproc.input=xdoc.nodeFromID(id) xslproc.output=Response ' parameter for message group xslproc.addParameter "msgid",CStr(id) xslproc.transform() %> why ? Thanks, Andrea
The code is transforming a XML file with XSLT to recreate a HTML document. If you place HTML code before, during or after the code, you will have a malformed HTML document since you will have HTML code outside of scope of the <html> tag. If you want to add HTML code, you must modify the messageboard.xsl document.
-
The code is transforming a XML file with XSLT to recreate a HTML document. If you place HTML code before, during or after the code, you will have a malformed HTML document since you will have HTML code outside of scope of the <html> tag. If you want to add HTML code, you must modify the messageboard.xsl document.
... I can not modify the asp file? or there is not another way to trasform xml ?
-
... I can not modify the asp file? or there is not another way to trasform xml ?
-
Yes I can, but I would want to add other code asp ...:-D
-
Yes I can, but I would want to add other code asp ...:-D
-
You want to add more ASP code? If the XSL does not change and HTML code concerning the body element and its ancestors, you can place that code in the ASP file. Then, you can add more ASP code before or after the transformed HTML code.
... kindly, can you give me an example with the post code? :-D
-
... kindly, can you give me an example with the post code? :-D
... the code I should change it so? my code asp <% ' View Message ' prevent page caching Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 xslpath = Server.mappath("viewmessage.xsl") '"d:\InetPub\wwwroot\XMLmessageboard\messageboard.xsl" xmlpath = Application("xmlpath") Set id = Request.QueryString("id") set xdoc = Application("xdoc") set xsldoc = Server.CreateObject("MSXML2.FreeThreadedDOMDocument") 'load up XSL doc and perform transformations xsldoc.async = false xsldoc.load(xslpath) set xsltemp = Server.createObject("MSXML2.XSLTemplate") xsltemp.stylesheet=xsldoc set xslproc = xsltemp.createProcessor xslproc.input=xdoc.nodeFromID(id) xslproc.output=Response ' parameter for message group xslproc.addParameter "msgid",CStr(id) xslproc.transform() my code asp %> Andrea
-
... the code I should change it so? my code asp <% ' View Message ' prevent page caching Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 xslpath = Server.mappath("viewmessage.xsl") '"d:\InetPub\wwwroot\XMLmessageboard\messageboard.xsl" xmlpath = Application("xmlpath") Set id = Request.QueryString("id") set xdoc = Application("xdoc") set xsldoc = Server.CreateObject("MSXML2.FreeThreadedDOMDocument") 'load up XSL doc and perform transformations xsldoc.async = false xsldoc.load(xslpath) set xsltemp = Server.createObject("MSXML2.XSLTemplate") xsltemp.stylesheet=xsldoc set xslproc = xsltemp.createProcessor xslproc.input=xdoc.nodeFromID(id) xslproc.output=Response ' parameter for message group xslproc.addParameter "msgid",CStr(id) xslproc.transform() my code asp %> Andrea
-
I try with my application and It give me the error: The page http://www.allinonenet.it/gamezone/gameaon/display.asp?gameid=4 ant the xsl http://www.allinonenet.it/gamezone/gameaon/gameaon.xsl The synbol is:ÿþ why :-) ?
-
I try with my application and It give me the error: The page http://www.allinonenet.it/gamezone/gameaon/display.asp?gameid=4 ant the xsl http://www.allinonenet.it/gamezone/gameaon/gameaon.xsl The synbol is:ÿþ why :-) ?
-
in the xsl page ?