Solved

XML encoding

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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…
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

773 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