Solved

XML encoding

Posted on 2012-12-21
5
311 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 9

Expert Comment

by:BlueYonder
ID: 38714583
0
 
LVL 18

Accepted Solution

by:
zc2 earned 500 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 18

Expert Comment

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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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/…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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