Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-04-26
1
Medium Priority
?
223 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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, …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

618 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