Solved

XML question about oxml.appendChild - Using Classic ASP.

Posted on 2006-10-20
1
260 Views
Last Modified: 2008-03-06
I have a question about creating an XML file.  How can I add some text to a XML element.  For example, I am currently creating and element named - <BillingData> but I want to really create this instead
<BillingData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://apogee.net/WebService">


Here is what i am producing now:

 <?xml version="1.0" ?>
- <BillingData>                    
  <BillingCycleData />
 - <UtilityId id="0">
  <meterReadDate>200509</meterReadDate>
  <revenue>118.94</revenue>
  <usuage>1208</usuage>
  </UtilityId>
  </BillingData>

Here is my code that create the BillingData element.

' create xml  
 oXML.appendChild(oXML.createProcessingInstruction("xml","version=""1.0"""))  
 oXML.appendChild(oXML.createElement("BillingData")    ????? can text be added to this statement

I want to create the BillingData so it looks like this:  

<BillingData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://apogee.net/WebService">
 
0
Comment
Question by:Hojoformo
1 Comment
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 17776128
oXML.appendChild(oXML.createProcessingInstruction("xml","version=""1.0"""))  
Set oChild = oXML.appendChild(oXML.createElement("BillingData"))
oChild.setAttribute "xmlns:xsd", "http://www.w3.org/2001/XMLSchema"
oChild.setAttribute "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"
oChild.setAttribute "xmlns", "http://apogee.net/WebService"
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now