Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating a New XML file from and Existing XML File 1

Status
Not open for further replies.

andre66

Programmer
Sep 2, 2003
2
GB
Hi all,

Hopefully some one here will be able to help me with this problem, as im pretty stumped.

I have an XML document provided by one of our customers that containd data in both the attributes and the elements.

Access only lets you import the data from the elements, but i also need the data from the attributes.

I have created an XSL document that uses XLST to create a new XML file with the attributes converted into elements.

My problem is that i cannot view result of the XSL document properly. Instead of a nicely formed XML document, it is output as a huge text string.

Here are the links to the documents:

- XML Document
- XSL Document
- XSL Output
- XSL Required Output

Many thanks in Advance.

Matt
 
IE is viewing the output as HTML, so it will ignore the tags and just output the values. Thus, you either have to escape all the < and > to &lt; and &gt; respectively, or simply save the output to an XML file rather than outputting it.

Jon

"I don't regret this, but I both rue and lament it.
 
Hi Jonty,

Thanks for your reply.

I am unsure however how to escape the values as i hav not had to do this before, might you be able to point me in the right direction?

regards

Matt
 
Something like this (not tested):
Code:
var output = proc.output;
output = output.replace(/</g, "&lt;").replace(/>/g, "&gt;");
target.innerHTML = output;

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top