Solved

Formatting a written XML file....

Posted on 2007-11-20
4
346 Views
Last Modified: 2011-10-03
Is there something I can do in classic ASP that is similar to:
xmlWriter.Formatting = Formatting.Indented

what I'm coming across is, as I write the values to the document it is coming in as:
<?xml version="1.0" encoding="utf-8"?>
<Facility_Reservations>
      <FAC_RESERVATION ID="111320070933"><FAC_ID>7</FAC_ID><FAC_RES_DATE>11/17/2010</FAC_RES_DATE><FAC_RES_AVAIL>NO</FAC_RES_AVAIL><FAC_RES_DESC>this is a test</FAC_RES_DESC></FAC_RESERVATION></Facility_Reservations>


what I need to do is make it:
<?xml version="1.0" encoding="utf-8"?>
<Facility_Reservations>
      <FAC_RESERVATION ID="111320070933">
    <FAC_ID>7</FAC_ID>
    <FAC_RES_DATE>11/17/2010</FAC_RES_DATE>
    <FAC_RES_AVAIL>NO</FAC_RES_AVAIL>
    <FAC_RES_DESC>this is a test</FAC_RES_DESC>
  </FAC_RESERVATION>
</Facility_Reservations>

xmlpath = server.MapPath("/club/scripts/Interfaces/" & tmpAccountName & ".xml")

    set objXML = CreateObject("Microsoft.FreeThreadedXMLDOM")

        objXML.async = False

        blnFileExist = objXML.load(xmlpath)

        If not(blnFileExist) Then

            'If the file does not exist, build it now

            objXML.appendChild(objXML.createProcessingInstruction("xml","version=""1.0"""))

            objXML.appendChild(objXML.createElement("RL"))

        End If

            'set our child node object

            Set objXMLv = objXML.createElement("CLUB")

                'Assign this node an ID, and give the ID a value

                objXMLv.setAttribute "ID", tmpClubID

                'Append some child nodes for the login to be stored

                objXMLv.appendChild(objXML.createElement("UID"))

                objXMLv.appendChild(objXML.createElement("UPW"))

                'after the nodes were made, we insert the information into them

                objXMLv.childNodes(0).text = tmpMemberNo

                objXMLv.childNodes(1).text = tmpPassword

                'append the nodes to the document

                objXML.documentElement.appendChild(objXMLv.cloneNode(true))

                'save the file

                objXML.save(xmlpath)

            Set objXMLv = nothing

    Set xmlObj = nothing

Open in new window

0
Comment
Question by:kevp75
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
Ashish Patel earned 500 total points
ID: 20319407
NO you cannot do this in classic ASP.
0
 
LVL 25

Author Comment

by:kevp75
ID: 20321421
there has to be a way.  I've seen many sites that write an XML file and upon getting it as an email attachment and openning it in Notepad it is formatted correctly...
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20321458
They generally put vbCRLF after a new child node is added. Anyways, i will look for more options for you to get you something you are looking by tomorrow.
0
 
LVL 25

Author Comment

by:kevp75
ID: 20358016
ya know...I believe I may have hit a wall with this.  I've searched around for a few days now, and everything points to .NET, and nothing about this for classic.

Thanks for the help...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Challenge to XML Gurus, (XML link downloads blank data while data exists) 10 57
Change to event 1 101
XSL - change date format 3 38
Extract XML Data from using TSQL 5 46
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.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

13 Experts available now in Live!

Get 1:1 Help Now