How to Display XML With JavaScript -


i have xml:

  <school>    <name>big school</name>    <located>somewhere</located>    <age>163</age>    <students>53354</students>  </school> 

i want add new element xml , display in browser. can use dom methods add new element not know how display in browser. found http://www.ehow.com/how_5941838_display-xml-javascript.html did not make work.

i want see in browser:

<school>    <name>big school</name>    <located>somewhere</located>    <age>163</age>    <students>53354</students>    <teachers>18752</teachers>  </school> 

can in simple way?

you wrap in xmp element, preserve formatting , display markup (not interpret html).

<xmp>     <school>         <name>big school</name>         <located>somewhere</located>         <age>163</age>         <students>53354</students>         <teachers>18752</teachers>     </school> </xmp> 

note though tag non standard , has been deprecated others noted, still works in major browsers , there seems no decent alternative (without using js or escaping content).


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -