Results 1 to 5 of 5
  1. #1

    how can i change text colors in this .xml file?

    <%

    ACTION = Request.QueryString("action")
    USER = Request.Cookies("username")
    BODY = Request.QueryString("msg")

    BODY = Replace(BODY,"","<img src=smile.gif>")
    BODY = Replace(BODY,"","<img src=mad.gif>")

    NUMERO_POST = 99999999

    Set objXML = server.CreateObject("Microsoft.XMLDOM")
    objXML.async = False

    blnFileExist = objXML.load(server.MapPath("msg.xml"))

    NUM = objXML.documentElement.childNodes.length

    if NUM > NUMERO_POST then

    objXML.documentElement.removechild(objXML.documentElement.childNodes(0))
    objXML.save(server.MapPath("msg.xml"))

    end if

    if ACTION = "add" then

    if USER <> "" AND BODY <> "" then

    Dim objXML, blnFileExist
    Dim objXMLv
    Dim intID

    Set objXML = server.CreateObject("Microsoft.XMLDOM")
    objXML.async = False

    blnFileExist = objXML.load(server.MapPath("msg.xml"))

    Set objXMLv = objXML.createElement("note")

    objXMLv.appendChild(objXML.createElement("from"))
    objXMLv.appendChild(objXML.createElement("body"))

    objXMLv.childNodes(0).text = USER
    objXMLv.childNodes(1).text = BODY

    objXML.documentElement.appendChild(objXMLv.cloneNode(True))
    objXML.save(server.MapPath("msg.xml"))

    end if

    end if

    Response.redirect("msg.xml")

    %>

  2. #2
    Join Date
    Mar 2004
    Location
    california
    Posts
    162
    Pretty sure IE automatically formats XML files.

  3. #3
    Join Date
    Nov 2003
    Location
    Earth
    Posts
    273
    XML's styles are defined in .xsl files, similar to .css files.
    Download the source code for "Beginning Active Server Pages 3.0" from Wrox Press
    http://web.wrox.com/0764543636/3382_all_chapters.zip
    I don't remember the chapter no. but you can find/search from the archive for .xml
    Hope it will help you.
    "An army of sheep led by a lion would defeat an army of lions led by a sheep"

  4. #4
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    To format XML files for display, you can use XSL, which is the CSS equivalent for XML.

    unlucky1:

    IE formats XML that doesn't have a XSL associated with it using an internal XSL definition (which is generic).
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  5. #5
    Join Date
    Feb 2004
    Posts
    772
    Hi

    You can set the color settings in your .xml file as

    <syntaxColor id="CodeColor_TemplateText" text="#999999" />
    <syntaxColor id="CodeColor_TemplateCommentText" text="#009900" />
    <syntaxColor id="CodeColor_TemplateCommentAttr" text="#009900" />

    Please.. have a look into the following URLs regarding setting different colors to your .xml file.

    http://dreamweavermx-templates.com/t.../tutcolors.cfm

    Regards,

    Bright

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •