swc/crates/swc_xml_parser/tests/fixture/basic-2/output.json
2022-08-01 03:56:12 +00:00

1323 lines
36 KiB
JSON

{
"type": "Document",
"span": {
"start": 1,
"end": 1605,
"ctxt": 0
},
"children": [
{
"type": "ProcessingInstruction",
"span": {
"start": 1,
"end": 22,
"ctxt": 0
},
"target": "xml",
"data": "version=\"1.0\""
},
{
"type": "Element",
"span": {
"start": 23,
"end": 1605,
"ctxt": 0
},
"tagName": "any_name",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "attr",
"rawName": "attr",
"value": "https://example.com/somepath",
"rawValue": "\"https://example.com/somepath\""
}
],
"children": [
{
"type": "Text",
"span": {
"start": 69,
"end": 74,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 74,
"end": 880,
"ctxt": 0
},
"tagName": "person",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "id",
"rawName": "id",
"value": "101",
"rawValue": "\"101\""
}
],
"children": [
{
"type": "Text",
"span": {
"start": 91,
"end": 100,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 100,
"end": 128,
"ctxt": 0
},
"tagName": "phone",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 107,
"end": 120,
"ctxt": 0
},
"data": "+122233344550",
"raw": "+122233344550"
}
]
},
{
"type": "Text",
"span": {
"start": 128,
"end": 137,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 137,
"end": 154,
"ctxt": 0
},
"tagName": "name",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 143,
"end": 147,
"ctxt": 0
},
"data": "Jack",
"raw": "Jack"
}
]
},
{
"type": "Text",
"span": {
"start": 154,
"end": 163,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 163,
"end": 191,
"ctxt": 0
},
"tagName": "phone",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 170,
"end": 183,
"ctxt": 0
},
"data": "+122233344551",
"raw": "+122233344551"
}
]
},
{
"type": "Text",
"span": {
"start": 191,
"end": 200,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 200,
"end": 213,
"ctxt": 0
},
"tagName": "age",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 205,
"end": 207,
"ctxt": 0
},
"data": "33",
"raw": "33"
}
]
},
{
"type": "Text",
"span": {
"start": 213,
"end": 222,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 222,
"end": 245,
"ctxt": 0
},
"tagName": "emptyNode",
"attributes": [],
"children": []
},
{
"type": "Text",
"span": {
"start": 245,
"end": 254,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 254,
"end": 286,
"ctxt": 0
},
"tagName": "booleanNode",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 267,
"end": 272,
"ctxt": 0
},
"data": "false",
"raw": "false"
}
]
},
{
"type": "Text",
"span": {
"start": 286,
"end": 295,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 295,
"end": 326,
"ctxt": 0
},
"tagName": "booleanNode",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 308,
"end": 312,
"ctxt": 0
},
"data": "true",
"raw": "true"
}
]
},
{
"type": "Text",
"span": {
"start": 326,
"end": 335,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 335,
"end": 350,
"ctxt": 0
},
"tagName": "selfclosing",
"attributes": [],
"children": []
},
{
"type": "Text",
"span": {
"start": 350,
"end": 359,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 359,
"end": 387,
"ctxt": 0
},
"tagName": "selfclosing",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "with",
"rawName": "with",
"value": "value",
"rawValue": "\"value\""
}
],
"children": []
},
{
"type": "Text",
"span": {
"start": 387,
"end": 396,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 396,
"end": 446,
"ctxt": 0
},
"tagName": "married",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "firstTime",
"rawName": "firstTime",
"value": "No",
"rawValue": "\"No\""
},
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "attr",
"rawName": "attr",
"value": "val 2",
"rawValue": "\"val 2\""
}
],
"children": [
{
"type": "Text",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"data": "Yes",
"raw": "Yes"
}
]
},
{
"type": "Text",
"span": {
"start": 446,
"end": 455,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 455,
"end": 507,
"ctxt": 0
},
"tagName": "birthday",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 465,
"end": 496,
"ctxt": 0
},
"data": "Wed, 28 Mar 1979 12:13:14 +0300",
"raw": "Wed, 28 Mar 1979 12:13:14 +0300"
}
]
},
{
"type": "Text",
"span": {
"start": 507,
"end": 516,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 516,
"end": 686,
"ctxt": 0
},
"tagName": "address",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 525,
"end": 538,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 538,
"end": 559,
"ctxt": 0
},
"tagName": "city",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 544,
"end": 552,
"ctxt": 0
},
"data": "New York",
"raw": "New York"
}
]
},
{
"type": "Text",
"span": {
"start": 559,
"end": 572,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 572,
"end": 597,
"ctxt": 0
},
"tagName": "street",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 580,
"end": 588,
"ctxt": 0
},
"data": "Park Ave",
"raw": "Park Ave"
}
]
},
{
"type": "Text",
"span": {
"start": 597,
"end": 610,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 610,
"end": 636,
"ctxt": 0
},
"tagName": "buildingNo",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 622,
"end": 623,
"ctxt": 0
},
"data": "1",
"raw": "1"
}
]
},
{
"type": "Text",
"span": {
"start": 636,
"end": 649,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 649,
"end": 667,
"ctxt": 0
},
"tagName": "flatNo",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 657,
"end": 658,
"ctxt": 0
},
"data": "1",
"raw": "1"
}
]
},
{
"type": "Text",
"span": {
"start": 667,
"end": 676,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
}
]
},
{
"type": "Text",
"span": {
"start": 686,
"end": 695,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 695,
"end": 866,
"ctxt": 0
},
"tagName": "address",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 704,
"end": 717,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 717,
"end": 736,
"ctxt": 0
},
"tagName": "city",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 723,
"end": 729,
"ctxt": 0
},
"data": "Boston",
"raw": "Boston"
}
]
},
{
"type": "Text",
"span": {
"start": 736,
"end": 749,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 749,
"end": 775,
"ctxt": 0
},
"tagName": "street",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 757,
"end": 766,
"ctxt": 0
},
"data": "Centre St",
"raw": "Centre St"
}
]
},
{
"type": "Text",
"span": {
"start": 775,
"end": 788,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 788,
"end": 815,
"ctxt": 0
},
"tagName": "buildingNo",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 800,
"end": 802,
"ctxt": 0
},
"data": "33",
"raw": "33"
}
]
},
{
"type": "Text",
"span": {
"start": 815,
"end": 828,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 828,
"end": 847,
"ctxt": 0
},
"tagName": "flatNo",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 836,
"end": 838,
"ctxt": 0
},
"data": "24",
"raw": "24"
}
]
},
{
"type": "Text",
"span": {
"start": 847,
"end": 856,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
}
]
},
{
"type": "Text",
"span": {
"start": 866,
"end": 871,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
}
]
},
{
"type": "Text",
"span": {
"start": 880,
"end": 885,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 885,
"end": 1593,
"ctxt": 0
},
"tagName": "person",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "id",
"rawName": "id",
"value": "102",
"rawValue": "\"102\""
}
],
"children": [
{
"type": "Text",
"span": {
"start": 902,
"end": 911,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 911,
"end": 939,
"ctxt": 0
},
"tagName": "phone",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 918,
"end": 931,
"ctxt": 0
},
"data": "+122233344553",
"raw": "+122233344553"
}
]
},
{
"type": "Text",
"span": {
"start": 939,
"end": 948,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 948,
"end": 966,
"ctxt": 0
},
"tagName": "name",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 954,
"end": 959,
"ctxt": 0
},
"data": "Boris",
"raw": "Boris"
}
]
},
{
"type": "Text",
"span": {
"start": 966,
"end": 975,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 975,
"end": 1003,
"ctxt": 0
},
"tagName": "phone",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 982,
"end": 995,
"ctxt": 0
},
"data": "+122233344554",
"raw": "+122233344554"
}
]
},
{
"type": "Text",
"span": {
"start": 1003,
"end": 1012,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1012,
"end": 1025,
"ctxt": 0
},
"tagName": "age",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1017,
"end": 1019,
"ctxt": 0
},
"data": "34",
"raw": "34"
}
]
},
{
"type": "Text",
"span": {
"start": 1025,
"end": 1026,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Comment",
"span": {
"start": 1026,
"end": 1128,
"ctxt": 0
},
"data": " TODO <married ns:firstTime=\"Yes\"><![CDATA[<some>Jack</some>]]><![CDATA[Jack]]></married>",
"raw": "<!-- TODO <married ns:firstTime=\"Yes\"><![CDATA[<some>Jack</some>]]><![CDATA[Jack]]></married>-->"
},
{
"type": "Text",
"span": {
"start": 1128,
"end": 1137,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1137,
"end": 1189,
"ctxt": 0
},
"tagName": "birthday",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1147,
"end": 1178,
"ctxt": 0
},
"data": "Mon, 31 Aug 1970 02:03:04 +0300",
"raw": "Mon, 31 Aug 1970 02:03:04 +0300"
}
]
},
{
"type": "Text",
"span": {
"start": 1189,
"end": 1198,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1198,
"end": 1405,
"ctxt": 0
},
"tagName": "ns:address",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1210,
"end": 1211,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Comment",
"span": {
"start": 1211,
"end": 1276,
"ctxt": 0
},
"data": " TODO <city><![CDATA[<some>Jack</some>]]></city>",
"raw": "<!-- TODO <city><![CDATA[<some>Jack</some>]]></city>-->"
},
{
"type": "Text",
"span": {
"start": 1276,
"end": 1289,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1289,
"end": 1313,
"ctxt": 0
},
"tagName": "street",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1297,
"end": 1304,
"ctxt": 0
},
"data": "Kahovka",
"raw": "Kahovka"
}
]
},
{
"type": "Text",
"span": {
"start": 1313,
"end": 1326,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1326,
"end": 1352,
"ctxt": 0
},
"tagName": "buildingNo",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1338,
"end": 1339,
"ctxt": 0
},
"data": "1",
"raw": "1"
}
]
},
{
"type": "Text",
"span": {
"start": 1352,
"end": 1365,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1365,
"end": 1383,
"ctxt": 0
},
"tagName": "flatNo",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1373,
"end": 1374,
"ctxt": 0
},
"data": "2",
"raw": "2"
}
]
},
{
"type": "Text",
"span": {
"start": 1383,
"end": 1392,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
}
]
},
{
"type": "Text",
"span": {
"start": 1405,
"end": 1414,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1414,
"end": 1579,
"ctxt": 0
},
"tagName": "address",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1423,
"end": 1436,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1436,
"end": 1453,
"ctxt": 0
},
"tagName": "city",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1442,
"end": 1446,
"ctxt": 0
},
"data": "Tula",
"raw": "Tula"
}
]
},
{
"type": "Text",
"span": {
"start": 1453,
"end": 1466,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1466,
"end": 1489,
"ctxt": 0
},
"tagName": "street",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1474,
"end": 1480,
"ctxt": 0
},
"data": "Lenina",
"raw": "Lenina"
}
]
},
{
"type": "Text",
"span": {
"start": 1489,
"end": 1502,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1502,
"end": 1528,
"ctxt": 0
},
"tagName": "buildingNo",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1514,
"end": 1515,
"ctxt": 0
},
"data": "3",
"raw": "3"
}
]
},
{
"type": "Text",
"span": {
"start": 1528,
"end": 1541,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 1541,
"end": 1560,
"ctxt": 0
},
"tagName": "flatNo",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 1549,
"end": 1551,
"ctxt": 0
},
"data": "78",
"raw": "78"
}
]
},
{
"type": "Text",
"span": {
"start": 1560,
"end": 1569,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
}
]
},
{
"type": "Text",
"span": {
"start": 1579,
"end": 1584,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
}
]
},
{
"type": "Text",
"span": {
"start": 1593,
"end": 1594,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
}
]
}
]
}