icargill
07-07-2009, 06:51 AM
I have some xml data that I need to display in a HTML page, and I can't get it to quite work how I want it. E.g. If I have an XML file and open it in a browser, it will display as 'pretty-printed' XML. I have an exiting page that I need to load the xml into for display.
I can run the xml through a routine to make it HTML safe (ie. convert <> etc to entities), then load it into the innerHTMl of a div, but there is no decent formatting.
I could labouriously write a parser to do it, but surely there must be some straightforward way of achieving this?? I've tried a few ways (e.g. loading into an IFrame), but still no luck.
I would appreciate any pointers.
I can run the xml through a routine to make it HTML safe (ie. convert <> etc to entities), then load it into the innerHTMl of a div, but there is no decent formatting.
I could labouriously write a parser to do it, but surely there must be some straightforward way of achieving this?? I've tried a few ways (e.g. loading into an IFrame), but still no luck.
I would appreciate any pointers.