473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Generate a new XML doc

Hi

Can someone tell me how I generate a new XML file that I can then use with an XSLT file. I am trying to use an XML file generated from Microsoft Project or even better generate an XML file from the project file (MPP File) itself. Which I can then use with an XSLT file

I am new to XML and want to create a project viewer using XML, ASP and XHTML. I have an idea of how this should work but would really appritiate any help someone can offer. Is it possible to take an XML file and generate it in ASP without using an XSLT file??

Help me please

Thanks...
Jul 19 '05 #1
1 2321


Tim:. wrote:
Can someone tell me how I generate a new XML file that I can then use
with an XSLT file. I am trying to use an XML file generated from
Microsoft Project or even better generate an XML file from the
project file (MPP File) itself. Which I can then use with an XSLT
file.

I am new to XML and want to create a project viewer using XML, ASP
and XHTML. I have an idea of how this should work but would really
appritiate any help someone can offer. Is it possible to take an XML
file and generate it in ASP without using an XSLT file???


If you want to create an XML document in memory you can use the DOM,
MSXML is the component that supports that, if you want to do it a lot
you might want to download MSXML 4 from msdn.microsoft.com, it comes
with an SDK documentation.
Here is an example ASP page that creates a DOM document with a root
element <riders> and two child <rider> elements and then outputs it to
the browser by transforming it to HTML:

<%@ Language="VBScript" %>
<%
Option Explicit
Dim XmlDocument, XmlElement, XslDocument
Set XmlDocument = Server.CreateObject("Msxml2.DOMDocument.4.0")
XmlDocument.AppendChild(xmlDocument.CreateElement( "riders"))
Set XmlElement = XmlDocument.CreateElement("rider")
XmlElement.AppendChild(XmlDocument.CreateTextNode( "Armstrong"))
XmlDocument.DocumentElement.AppendChild(XmlElement )
Set XmlElement = XmlDocument.CreateElement("rider")
XmlElement.AppendChild(XmlDocument.CreateTextNode( "Ullrich"))
XmlDocument.DocumentElement.AppendChild(XmlElement )

Set XslDocument = Server.CreateObject("Msxml2.DOMDocument.4.0")
XslDocument.Async = False
XslDocument.Load(Server.MapPath("test20040402Xsl.x ml"))

XmlDocument.TransformNodeToObject XslDocument, Response
%>

The XSLT example is

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output method="html" indent="yes" encoding="UTF-8" />

<xsl:template match="/">
<html>
<head>
<title>Riders</title>
</head>
<body>
<xsl:apply-templates select="riders" />
</body>
</html>
</xsl:template>

<xsl:template match="riders">
<ol><xsl:apply-templates select="rider" /></ol>
</xsl:template>

<xsl:template match="rider">
<li><xsl:value-of select="." /></li>
</xsl:template>

</xsl:stylesheet>
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Almoni | last post by:
Hi, I have a few .xsd files that include each other in the following way: <!-- lets call the main schema file AA.xsd and it includes BB.xsd inside it --> <xs:schema...
3
by: Garry Dawkins | last post by:
Hey Frank, I'm a novice with this taking over someone elses application. I'm attempting to add a dataset to a page. I have the query to populate the page and I have the walkthrough instructions. ...
1
by: jtsree | last post by:
I am Using (Windows XP) Visual Studio.net 2003 professional edition working on VB.net language. I am bulding a very very simple project in VB.net where i connect to Access Database by dragging...
9
by: Henk Verhoeven | last post by:
We are not alone! "Where other MDA tools are generating programmingcode, Codeless chooses not to generate code at all". OK, phpPeanuts is not an MDA tool (it has no fancy modeling GUI). But it...
4
by: Stephen | last post by:
I need to generate input XML for another application by serialising classes defined in an XSD document. The code below will generate the XML I require but I need to generate this in memory rather...
10
by: Mamuninfo | last post by:
Hello, Have any function in the DB2 database that can generate unique id for each string like oracle, mysql,sybase,sqlserver database. In mysql:- select md5(concat_ws("Row name")) from...
1
by: A Traveler | last post by:
Hello, i am having this problem. The exact error message is: "Unable to generate code for a value of type 'System.Web.UI.Page'. This error occurred while trying to generate the property value for...
5
by: pete | last post by:
Help, I can not find this data wizard in my toolbox under data. To generate a dataset 1.. From the Data menu, choose Generate DataSet. Tip If you do not see the Data menu, click in the...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
2
by: bthubbard | last post by:
This may not be the best group in which to post this. If there is a better location please direct me there. I have been experimenting with Sandcastle to generate CHM help file documentation for...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.