DOM2 Reference

Document.createProcessingInstruction

Source:
JavaScript:
  var pi = document.createProcessingInstruction('php', 'echo("another example")');
  var output1 = pi.nodeType;
  var output2 = pi.target;
  var output3 = pi.data;
Output:
desired your browser
output1: 7
output2: php
output3: echo("some example")


Remarks:
  • it seems that all relevant browsers support JavaScript try-catch statement therefore all examples are encapsulated with it (it avoids alert-popups)
  • thanks to White Space Handling in XML 1.0 specification default handling of white-spaces completely depends on XML application (note: WinIE do not preserve white-spaces by default while MacIE and Mozilla does)
  • during development tested with Mozilla night-builds, Netscape6, MicrosoftInternetExplorer5.5 and Opera5.02 on Windows2000



_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | IDOOX