Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XML MessageBoard

XML MessageBoard

Scheduled Pinned Locked Moved XML / XSL
xmlhtmlcomsysadmintools
12 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A AndreaTheDove

    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

    G Offline
    G Offline
    Geo Pa
    wrote on last edited by
    #2

    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.

    A 1 Reply Last reply
    0
    • G Geo Pa

      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.

      A Offline
      A Offline
      AndreaTheDove
      wrote on last edited by
      #3

      ... I can not modify the asp file? or there is not another way to trasform xml ?

      G 1 Reply Last reply
      0
      • A AndreaTheDove

        ... I can not modify the asp file? or there is not another way to trasform xml ?

        G Offline
        G Offline
        Geo Pa
        wrote on last edited by
        #4

        Can you modify the xsl file?

        A 1 Reply Last reply
        0
        • G Geo Pa

          Can you modify the xsl file?

          A Offline
          A Offline
          AndreaTheDove
          wrote on last edited by
          #5

          Yes I can, but I would want to add other code asp ...:-D

          G 1 Reply Last reply
          0
          • A AndreaTheDove

            Yes I can, but I would want to add other code asp ...:-D

            G Offline
            G Offline
            Geo Pa
            wrote on last edited by
            #6

            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.

            A 1 Reply Last reply
            0
            • G Geo Pa

              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.

              A Offline
              A Offline
              AndreaTheDove
              wrote on last edited by
              #7

              ... kindly, can you give me an example with the post code? :-D

              A 1 Reply Last reply
              0
              • A AndreaTheDove

                ... kindly, can you give me an example with the post code? :-D

                A Offline
                A Offline
                AndreaTheDove
                wrote on last edited by
                #8

                ... 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

                G 1 Reply Last reply
                0
                • A AndreaTheDove

                  ... 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

                  G Offline
                  G Offline
                  Geo Pa
                  wrote on last edited by
                  #9

                  Yes, just make sure that the HTML, HEAD and BODY elements aren't in the messageboard.xsl.

                  A 1 Reply Last reply
                  0
                  • G Geo Pa

                    Yes, just make sure that the HTML, HEAD and BODY elements aren't in the messageboard.xsl.

                    A Offline
                    A Offline
                    AndreaTheDove
                    wrote on last edited by
                    #10

                    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 :-) ?

                    G 1 Reply Last reply
                    0
                    • A AndreaTheDove

                      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 :-) ?

                      G Offline
                      G Offline
                      Geo Pa
                      wrote on last edited by
                      #11

                      I cannot help you here since you are embedding and object in your page.

                      A 1 Reply Last reply
                      0
                      • G Geo Pa

                        I cannot help you here since you are embedding and object in your page.

                        A Offline
                        A Offline
                        AndreaTheDove
                        wrote on last edited by
                        #12

                        in the xsl page ?

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups