| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
gTestfile = 'regress-350442.js'; |
| 8 |
|
| 9 |
var BUGNUMBER = 350442; |
| 10 |
var summary = 'toXMLString with namespace definitions'; |
| 11 |
var actual, expect; |
| 12 |
|
| 13 |
printBugNumber(BUGNUMBER); |
| 14 |
START(summary); |
| 15 |
|
| 16 |
expect = false; |
| 17 |
actual = false; |
| 18 |
|
| 19 |
try |
| 20 |
{ |
| 21 |
var t1 = <tag1 xmlns="http://ns1"/>; |
| 22 |
var n2 = new Namespace("http://ns2"); |
| 23 |
t1.@n2::a1="a1 from ns2"; |
| 24 |
|
| 25 |
var t1XMLString = t1.toXMLString(); |
| 26 |
|
| 27 |
var attrMatch = /xmlns:([^=]+)="http:\/\/ns2"/.exec(t1XMLString); |
| 28 |
if (!attrMatch) |
| 29 |
throw "No @n2::a1 attribute present"; |
| 30 |
|
| 31 |
var nsRegexp = new RegExp(attrMatch[1] + ':a1="a1 from ns2"'); |
| 32 |
if (!nsRegexp.test(t1XMLString)) |
| 33 |
throw "No namespace declaration present for @ns2::a1"; |
| 34 |
} |
| 35 |
catch (e) |
| 36 |
{ |
| 37 |
actual = e; |
| 38 |
} |
| 39 |
|
| 40 |
TEST(1, expect, actual); |
| 41 |
|
| 42 |
END(); |