Solved

Create XML with some data dynamically and retrieve data from xml using ASP.

Posted on 2004-04-26
1
221 Views
Last Modified: 2012-06-27
I have 2 tasks to do using ASP.

1. To create XML dynamically with some data and store them in any specified directory in the web server.
2. To retrieve data from any specified xml and display them using HTML elements for better GUI.  

Please answer them with sample code asap. Thanks.


0
Comment
Question by:Justlogin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 26

Accepted Solution

by:
rdcpro earned 250 total points
ID: 10923181
Pretty vague requirements, but this:

<%@language=VBScript%>
<%
Set xmlDoc = Server.CreateObject("Msxml2.DomDocument")
Set oNode = xmlDoc.createElement("myTime")
oNode.text = CStr(Now)
xmlDoc.appendChild oNode
xmlDoc.save Server.MapPath("currentTime.xml")

Set xmlSource = Server.CreateObject("Msxml2.DomDocument")
xmlSource.async = true
xmlSource.load Server.MapPath("currentTime.xml")

Set xslDoc = Server.CreateObject("Msxml2.DomDocument")
xslDoc.async = true
xslDoc.load Server.MapPath("TimeTest.xslt")
xmlDoc.transformNodeToObject xslDoc, Response
%>

along with this XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
      <xsl:template match="/">
            <h1><xsl:value-of select="myTime"/></h1>
      </xsl:template>
</xsl:stylesheet>

does what you ask, producing this output:

<h1>4/26/2004 3:30:46 PM</h1>


Regards,
Mike Sharp
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question