swc/crates/swc_xml_parser/tests/fixture/comments/output.json
2022-12-03 03:52:48 +00:00

511 lines
11 KiB
JSON

{
"type": "Document",
"span": {
"start": 1,
"end": 606,
"ctxt": 0
},
"children": [
{
"type": "ProcessingInstruction",
"span": {
"start": 1,
"end": 39,
"ctxt": 0
},
"target": "xml",
"data": "version=\"1.0\" encoding=\"UTF-8\""
},
{
"type": "Comment",
"span": {
"start": 40,
"end": 59,
"ctxt": 0
},
"data": " My Comment ",
"raw": "<!-- My Comment -->"
},
{
"type": "Element",
"span": {
"start": 60,
"end": 604,
"ctxt": 0
},
"tagName": "root",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 66,
"end": 71,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 71,
"end": 85,
"ctxt": 0
},
"data": "comment",
"raw": "<!--comment-->"
},
{
"type": "Text",
"span": {
"start": 85,
"end": 90,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 90,
"end": 103,
"ctxt": 0
},
"data": "<head>",
"raw": "<!--<head>-->"
},
{
"type": "Text",
"span": {
"start": 103,
"end": 108,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 108,
"end": 119,
"ctxt": 0
},
"data": "<!-x",
"raw": "<!--<!-x-->"
},
{
"type": "Text",
"span": {
"start": 119,
"end": 124,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 124,
"end": 134,
"ctxt": 0
},
"data": "<!x",
"raw": "<!--<!x-->"
},
{
"type": "Text",
"span": {
"start": 134,
"end": 139,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 139,
"end": 150,
"ctxt": 0
},
"data": "<<!x",
"raw": "<!--<<!x-->"
},
{
"type": "Text",
"span": {
"start": 150,
"end": 155,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 155,
"end": 167,
"ctxt": 0
},
"data": "<<!-x",
"raw": "<!--<<!-x-->"
},
{
"type": "Text",
"span": {
"start": 167,
"end": 172,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 172,
"end": 181,
"ctxt": 0
},
"data": "<x",
"raw": "<!--<x-->"
},
{
"type": "Text",
"span": {
"start": 181,
"end": 186,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 186,
"end": 195,
"ctxt": 0
},
"data": "<>",
"raw": "<!--<>-->"
},
{
"type": "Text",
"span": {
"start": 195,
"end": 200,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 200,
"end": 208,
"ctxt": 0
},
"data": "<",
"raw": "<!--<-->"
},
{
"type": "Text",
"span": {
"start": 208,
"end": 213,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 213,
"end": 222,
"ctxt": 0
},
"data": "<!",
"raw": "<!--<!-->"
},
{
"type": "Text",
"span": {
"start": 222,
"end": 227,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 227,
"end": 234,
"ctxt": 0
},
"data": "",
"raw": "<!---->"
},
{
"type": "Text",
"span": {
"start": 234,
"end": 239,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 239,
"end": 252,
"ctxt": 0
},
"data": "-a->-a",
"raw": "<!---a->-a-->"
},
{
"type": "Text",
"span": {
"start": 252,
"end": 257,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 257,
"end": 274,
"ctxt": 0
},
"data": "-<!-test->",
"raw": "<!---<!-test->-->"
},
{
"type": "Text",
"span": {
"start": 274,
"end": 279,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 279,
"end": 429,
"ctxt": 0
},
"tagName": "DocumentElement",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "myAttribute",
"rawName": "myAttribute",
"value": "myAttributeValue",
"rawValue": "\"myAttributeValue\""
}
],
"children": [
{
"type": "Text",
"span": {
"start": 327,
"end": 336,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Comment",
"span": {
"start": 336,
"end": 355,
"ctxt": 0
},
"data": " My Comment ",
"raw": "<!-- My Comment -->"
},
{
"type": "Text",
"span": {
"start": 355,
"end": 364,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 364,
"end": 406,
"ctxt": 0
},
"tagName": "ChildElement",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 378,
"end": 391,
"ctxt": 0
},
"data": "Element Value",
"raw": "Element Value"
}
]
},
{
"type": "Text",
"span": {
"start": 406,
"end": 411,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
}
]
},
{
"type": "Text",
"span": {
"start": 429,
"end": 434,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 434,
"end": 596,
"ctxt": 0
},
"tagName": "DocumentElement",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "myAttribute",
"rawName": "myAttribute",
"value": "my Attribute Value",
"rawValue": "\"my Attribute Value\""
}
],
"children": [
{
"type": "Text",
"span": {
"start": 484,
"end": 493,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
},
{
"type": "Element",
"span": {
"start": 493,
"end": 573,
"ctxt": 0
},
"tagName": "ChildElement",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 507,
"end": 524,
"ctxt": 0
},
"data": "\n Element ",
"raw": "\n Element "
},
{
"type": "Comment",
"span": {
"start": 524,
"end": 543,
"ctxt": 0
},
"data": " My Comment ",
"raw": "<!-- My Comment -->"
},
{
"type": "Text",
"span": {
"start": 543,
"end": 558,
"ctxt": 0
},
"data": " Value\n ",
"raw": " Value\n "
}
]
},
{
"type": "Text",
"span": {
"start": 573,
"end": 578,
"ctxt": 0
},
"data": "\n ",
"raw": "\n "
}
]
},
{
"type": "Text",
"span": {
"start": 596,
"end": 597,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
}
]
}
]
}