1

I have an Json object or xml Data that I would like to preview this in html as React is doing: https://github.com/marushkevych/xml-display-component but I don't want to mix Javascript and Reactjs. I hope someone can help me.

Example of my Xml: I want this to show as a tree , as the same xml format.Click to see the example

1 Answer 1

0

You can use something like the vkBeautify Plugin.

http://www.eslinstructor.net/vkbeautify/

Or maybe write your own formatting logic.

If I get it right, you want to pretty print XML and JSON Data as HTML in a Webbrowser with Javascript.

Take a look at this Question: Pretty printing XML with javascript

7
  • Thanks for your reply... I can use a pretty print too that vkBeautify Plugin is doing. But I was looking for a module because I'd like to preview the xml with the possibility to show it as a Tree. raw.githubusercontent.com/marushkevych/xml-display-component/… Apr 6, 2016 at 8:50
  • Try sth else... like_ levmuchnik.net/Content/ProgrammingTips/WEB/XMLDisplay/…
    – Scriptlabs
    Apr 6, 2016 at 10:05
  • Thanks. But I don't have a static file, the xml is generated on Server . I think I need to build my logic... I am trying to find some modules and nothing, the only way I found React but Idk if is a good idea mix with React. Otherwise I can find a module to make Trees and modify it to implement xml tags. What do you think? Apr 6, 2016 at 10:16
  • 1
    Hey Yes, THANKS, I was spending time trying to realise where to find the loadXmlString() function. and you got it. I am going to try this code. I will let you know how is going. Apr 6, 2016 at 10:41
  • 1
    It's going great. Thanks Apr 6, 2016 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.