Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

XML encoding

Posted on 2012-12-21
5
Medium Priority
?
323 Views
Last Modified: 2012-12-21
Hello,
I am making a log system to capture xml that is retrieved using a Classic ASP page.
Sample A is the code that makes the log
Sample B is a sample of the result which has what appears to be encoded values
Ex  <  $gt;  etc
I'd like the Sample B in the log file to appear as xml without these encodings.

How can I do that?  Some sort of decode?



Sample A:
      Dim xmlDoc, rootEl, child1, child2, p
      Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
      Set rootEl = xmlDoc.createElement("root")
      xmlDoc.appendChild rootEl
      Set child1 = xmlDoc.createElement("child1")
      Set child2 = xmlDoc.createElement("child2")
      child1.text = l
      child2.text = PEBFRQ.xml & PEBFRS.xml
      rootEl.appendChild child1
      rootEl.appendChild child2
      Set p = xmlDoc.createProcessingInstruction("xml","version='1.0'")
      xmlDoc.insertBefore p,xmlDoc.childNodes(0)
      xmlDoc.Save Server.MapPath("log\" &  key & "_RunInsertAPOHBTUB" &   ".xml")


Sample B
<?xml version="1.0"?>
<root><child1>Log started at 12/21/2012 5:20:12 PM</child1><child2>&lt;sbixml&gt;
      &lt;NetSightMessage&gt;
            &lt;Header&gt;
                  &lt;CurrentLedgers GL="GL" JL="JL"/&gt;
                  &lt;UserID&gt;BSIBRUN&lt;/UserID&gt;
0
Comment
Question by:KeithMcElroy
  • 2
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
zc2 earned 2000 total points
ID: 38714626
What are PEBFRQ.xml & PEBFRS.xml ?
Are they just string variables? Or XML objects?
If they are XML documents, try the following code instead of
the "child2.text = PEBFRQ.xml & PEBFRS.xml" line:

child2.appendChild( PEBFRQ.documentElement.cloneNode(TRUE) )
child2.appendChild( PEBFRS.documentElement.cloneNode(TRUE) )

Open in new window

0
 

Author Comment

by:KeithMcElroy
ID: 38714666
Perfect, works like a charm.  This would have taken me forever and a day
to figure out.  Thanks a bunch!
0
 

Author Closing Comment

by:KeithMcElroy
ID: 38714667
A+++++++  
Thank you!
0
 
LVL 19

Expert Comment

by:zc2
ID: 38714675
You're welcome!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

926 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