Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XML encoding

Posted on 2012-12-21
5
Medium Priority
?
317 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
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 this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

715 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