Solved

XML question about oxml.appendChild - Using Classic ASP.

Posted on 2006-10-20
1
269 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

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…

733 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