xmlns-unbound-element.js 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. require(__dirname).test(
  2. { strict : true
  3. , opt : { xmlns: true }
  4. , expect :
  5. [ [ "error", "Unbound namespace prefix: \"unbound:root\"\nLine: 0\nColumn: 15\nChar: >"]
  6. , [ "opentag", { name: "unbound:root", uri: "unbound", prefix: "unbound", local: "root"
  7. , attributes: {}, ns: {}, isSelfClosing: true } ]
  8. , [ "closetag", "unbound:root" ]
  9. ]
  10. }
  11. ).write("<unbound:root/>");
  12. require(__dirname).test(
  13. { strict : true
  14. , opt : { xmlns: true }
  15. , expect :
  16. [ [ "opennamespace", { prefix: "unbound", uri: "someuri" } ]
  17. , [ "attribute", { name: 'xmlns:unbound', value: 'someuri'
  18. , prefix: 'xmlns', local: 'unbound'
  19. , uri: 'http://www.w3.org/2000/xmlns/' } ]
  20. , [ "opentag", { name: "unbound:root", uri: "someuri", prefix: "unbound", local: "root"
  21. , attributes: { 'xmlns:unbound': {
  22. name: 'xmlns:unbound'
  23. , value: 'someuri'
  24. , prefix: 'xmlns'
  25. , local: 'unbound'
  26. , uri: 'http://www.w3.org/2000/xmlns/' } }
  27. , ns: { "unbound": "someuri" }, isSelfClosing: true } ]
  28. , [ "closetag", "unbound:root" ]
  29. , [ "closenamespace", { prefix: 'unbound', uri: 'someuri' }]
  30. ]
  31. }
  32. ).write("<unbound:root xmlns:unbound=\"someuri\"/>");