Solved

XML encoding

Posted on 2012-12-21
5
316 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
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

Independent Software Vendors: 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

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

622 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