Guest User

Untitled

a guest
May 19th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. -------------------------------------------------------------
  2.  
  3. --1--
  4. javascript sample:
  5. var x = xmlDoc.getElementsByTagName("tag");
  6. var strings= new String;
  7. strings="";
  8. for (i=0;i<x.length;i++)
  9. {
  10. strings=strings+(x[i].childNodes[0].nodeValue);
  11. strings=strings+("\n");
  12. }
  13. document.getElementById("categories").innerHTML=strings;
  14.  
  15. -------------------------------------------------------------
  16.  
  17. --2--
  18. javascript sample:
  19. <tag>&apos;name&amp;&amp;&quot;</tag>
  20.  
  21. -------------------------------------------------------------
  22.  
  23. --3--
  24. xml sample:
  25. <categories>
  26. <items>
  27. <tag>&lt;mark&gt;</tag>
  28. </items>
  29. <items>
  30. <tag>&amp;mark1&amp;</tag>
  31. </items>
  32. <items>
  33. <tag>&quot;mark2&quot;</tag>
  34. </items>
  35. <items>
  36. <tag>&apos;mark3&apos;</tag>
  37. </items>
  38. </categories>
  39.  
  40. ----------------------------------------------------------------
  41.  
  42. --4--
  43. output:
  44. black line where "mark" with show be with less than and greater than
  45. &mark1&
  46. "mark2"
  47. 'mark3'
Advertisement
Add Comment
Please, Sign In to add comment