Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Creating an XML document with ASP

Avatar of emzi19
emzi19 asked on
ASP
3 Comments1 Solution3260 ViewsLast Modified:
Hi,

I am creating an XML document from ASP and have the following code, which works fine..

_______________________________________

<%@LANGUAGE = "VBScript" %>
<%
Response.Buffer = False
'ensure proper headers sent to the client
Response.ContentType = "text/xml"
%>
<%
'these are our variables
Dim objXML , objNews, objPI
'create an instance of the DOM
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
Set objPI = objXML.createProcessingInstruction("xml", "version='1.0'")
'Set objPI2 = objXML.createProcessingInstruction ("xml-stylesheet", "type='text/xsl'", "href='eBIS_MAM.xsl'")
objXML.insertBefore objPI, objXML.childNodes(0)

'Create our root element using the createElement method
Set objXML.documentElement = objXML.createElement("Header")
'Create the newsitem element
Set objNews = objXML.createElement("Manifest")
'now we will create all the child elements in this case
'title , link and description
objNews.appendChild objXML.createElement("document")
objNews.appendChild objXML.createElement("name")
objNews.appendChild objXML.createElement("description")
'now we add values to the child elements
objNews.childNodes(0).text = "programmingsite.co.uk"
objNews.childNodes(1).text = "http://www.programmingsite.co.uk"
objNews.childNodes(2).text = "programming resources"
'add the newsitem element to the news element
objXML.documentElement.appendChild objNews.cloneNode(true)
'write the document using the xml method of the DOM

Response.Write objXML.xml
objXML.save "upload\genertexmlfile.xml"

%>
_______________________________________

The out put is the following,,,


........................................................................

  <?xml version="1.0" ?>
- <Header>
- <Manifest>
  <document>programmingsite.co.uk</document>
  <name>http://www.programmingsite.co.uk</name>
  <description>programming resources</description>
  </Manifest>
  </Header>

..............................................................................

___________________________________________________

I want to achieve an output the same as...

<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="bus.xsl"?>
<biztalk_1 xmlns="urn:schemas-biztalk-org:biztalk:biztalk_1">
<header xmlns="">
<manifest>
<document>
<name>Order</name>
<description>order</description>
</document>
</manifest>
</header>
</biztalk_1>

....................................

How can I do this?
ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0ttFlag of United States of America imageIT Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers