xml.test.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. 'use strict';
  6. import {testTokenization} from './testRunner';
  7. testTokenization('xml', [
  8. // Complete Start Tag with Whitespace
  9. [{
  10. line: '<person>',
  11. tokens: [
  12. { startIndex: 0, type: 'delimiter.start.xml' },
  13. { startIndex: 1, type: 'tag.tag-person.xml' },
  14. { startIndex: 7, type: 'delimiter.start.xml' }
  15. ]}],
  16. [{
  17. line: '<person/>',
  18. tokens: [
  19. { startIndex: 0, type: 'delimiter.start.xml' },
  20. { startIndex: 1, type: 'tag.tag-person.xml' },
  21. { startIndex: 8, type: 'delimiter.start.xml' }
  22. ]}],
  23. [{
  24. line: '<person >',
  25. tokens: [
  26. { startIndex: 0, type: 'delimiter.start.xml' },
  27. { startIndex: 1, type: 'tag.tag-person.xml' },
  28. { startIndex: 7, type: '' },
  29. { startIndex: 8, type: 'delimiter.start.xml' }
  30. ]}],
  31. [{
  32. line: '<person />',
  33. tokens: [
  34. { startIndex: 0, type: 'delimiter.start.xml' },
  35. { startIndex: 1, type: 'tag.tag-person.xml' },
  36. { startIndex: 7, type: '' },
  37. { startIndex: 8, type: 'tag.tag-person.xml' },
  38. { startIndex: 9, type: 'delimiter.start.xml' }
  39. ]}],
  40. // Incomplete Start Tag
  41. [{
  42. line: '<',
  43. tokens: [
  44. { startIndex: 0, type: '' }
  45. ]}],
  46. [{
  47. line: '<person',
  48. tokens: [
  49. { startIndex: 0, type: 'delimiter.start.xml' },
  50. { startIndex: 1, type: 'tag.tag-person.xml' }
  51. ]}],
  52. [{
  53. line: '<input',
  54. tokens: [
  55. { startIndex: 0, type: 'delimiter.start.xml' },
  56. { startIndex: 1, type: 'tag.tag-input.xml' }
  57. ]}],
  58. // Invalid Open Start Tag
  59. [{
  60. line: '< person',
  61. tokens: [
  62. { startIndex: 0, type: '' }
  63. ]}],
  64. [{
  65. line: '< person>',
  66. tokens: [
  67. { startIndex: 0, type: '' }
  68. ]}],
  69. [{
  70. line: 'i <person;',
  71. tokens: [
  72. { startIndex: 0, type: '' },
  73. { startIndex: 2, type: 'delimiter.start.xml' },
  74. { startIndex: 3, type: 'tag.tag-person.xml' },
  75. { startIndex: 9, type: '' }
  76. ]}],
  77. // Tag with Attribute
  78. [{
  79. line: '<tool name="">',
  80. tokens: [
  81. { startIndex: 0, type: 'delimiter.start.xml' },
  82. { startIndex: 1, type: 'tag.tag-tool.xml' },
  83. { startIndex: 5, type: '' },
  84. { startIndex: 6, type: 'attribute.name.xml' },
  85. { startIndex: 10, type: '' },
  86. { startIndex: 11, type: 'attribute.value.xml' },
  87. { startIndex: 13, type: 'delimiter.start.xml' }
  88. ]}],
  89. [{
  90. line: '<tool name="Monaco">',
  91. tokens: [
  92. { startIndex: 0, type: 'delimiter.start.xml' },
  93. { startIndex: 1, type: 'tag.tag-tool.xml' },
  94. { startIndex: 5, type: '' },
  95. { startIndex: 6, type: 'attribute.name.xml' },
  96. { startIndex: 10, type: '' },
  97. { startIndex: 11, type: 'attribute.value.xml' },
  98. { startIndex: 19, type: 'delimiter.start.xml' }
  99. ]}],
  100. [{
  101. line: '<tool name=\'Monaco\'>',
  102. tokens: [
  103. { startIndex: 0, type: 'delimiter.start.xml' },
  104. { startIndex: 1, type: 'tag.tag-tool.xml' },
  105. { startIndex: 5, type: '' },
  106. { startIndex: 6, type: 'attribute.name.xml' },
  107. { startIndex: 10, type: '' },
  108. { startIndex: 11, type: 'attribute.value.xml' },
  109. { startIndex: 19, type: 'delimiter.start.xml' }
  110. ]}],
  111. // Tag with Attributes
  112. [{
  113. line: '<tool name="Monaco" version="1.0">',
  114. tokens: [
  115. { startIndex: 0, type: 'delimiter.start.xml' },
  116. { startIndex: 1, type: 'tag.tag-tool.xml' },
  117. { startIndex: 5, type: '' },
  118. { startIndex: 6, type: 'attribute.name.xml' },
  119. { startIndex: 10, type: '' },
  120. { startIndex: 11, type: 'attribute.value.xml' },
  121. { startIndex: 19, type: '' },
  122. { startIndex: 20, type: 'attribute.name.xml' },
  123. { startIndex: 27, type: '' },
  124. { startIndex: 28, type: 'attribute.value.xml' },
  125. { startIndex: 33, type: 'delimiter.start.xml' }
  126. ]}],
  127. // Tag with Name-Only-Attribute
  128. [{
  129. line: '<tool name>',
  130. tokens: [
  131. { startIndex: 0, type: 'delimiter.start.xml' },
  132. { startIndex: 1, type: 'tag.tag-tool.xml' },
  133. { startIndex: 5, type: '' },
  134. { startIndex: 6, type: 'attribute.name.xml' },
  135. { startIndex: 10, type: 'delimiter.start.xml' }
  136. ]}],
  137. [{
  138. line: '<tool name version>',
  139. tokens: [
  140. { startIndex: 0, type: 'delimiter.start.xml' },
  141. { startIndex: 1, type: 'tag.tag-tool.xml' },
  142. { startIndex: 5, type: '' },
  143. { startIndex: 6, type: 'attribute.name.xml' },
  144. { startIndex: 10, type: '' },
  145. { startIndex: 11, type: 'attribute.name.xml' },
  146. { startIndex: 18, type: 'delimiter.start.xml' }
  147. ]}],
  148. // Tag with Attribute And Whitespace
  149. [{
  150. line: '<tool name= "monaco">',
  151. tokens: [
  152. { startIndex: 0, type: 'delimiter.start.xml' },
  153. { startIndex: 1, type: 'tag.tag-tool.xml' },
  154. { startIndex: 5, type: '' },
  155. { startIndex: 6, type: 'attribute.name.xml' },
  156. { startIndex: 10, type: '' },
  157. { startIndex: 13, type: 'attribute.value.xml' },
  158. { startIndex: 21, type: 'delimiter.start.xml' }
  159. ]}],
  160. [{
  161. line: '<tool name = "monaco">',
  162. tokens: [
  163. { startIndex: 0, type: 'delimiter.start.xml' },
  164. { startIndex: 1, type: 'tag.tag-tool.xml' },
  165. { startIndex: 5, type: '' },
  166. { startIndex: 6, type: 'attribute.name.xml' },
  167. { startIndex: 10, type: '' },
  168. { startIndex: 13, type: 'attribute.value.xml' },
  169. { startIndex: 21, type: 'delimiter.start.xml' }
  170. ]}],
  171. // Tag with Invalid Attribute Name
  172. [{
  173. line: '<tool name!@#="bar">',
  174. tokens: [
  175. { startIndex: 0, type: 'delimiter.start.xml' },
  176. { startIndex: 1, type: 'tag.tag-tool.xml' },
  177. { startIndex: 5, type: '' },
  178. { startIndex: 6, type: 'attribute.name.xml' },
  179. { startIndex: 10, type: '' },
  180. { startIndex: 15, type: 'attribute.name.xml' },
  181. { startIndex: 18, type: '' },
  182. { startIndex: 19, type: 'delimiter.start.xml' }
  183. ]}],
  184. // Tag with Invalid Attribute Value
  185. [{
  186. line: '<tool name=">',
  187. tokens: [
  188. { startIndex: 0, type: 'delimiter.start.xml' },
  189. { startIndex: 1, type: 'tag.tag-tool.xml' },
  190. { startIndex: 5, type: '' },
  191. { startIndex: 6, type: 'attribute.name.xml' },
  192. { startIndex: 10, type: '' },
  193. { startIndex: 11, type: 'attribute.value.xml' },
  194. { startIndex: 12, type: 'delimiter.start.xml' }
  195. ]}],
  196. // Complete End Tag
  197. [{
  198. line: '</person>',
  199. tokens: [
  200. { startIndex: 0, type: 'delimiter.end.xml' },
  201. { startIndex: 2, type: 'tag.tag-person.xml' },
  202. { startIndex: 8, type: 'delimiter.end.xml' }
  203. ]}],
  204. // Complete End Tag with Whitespace
  205. [{
  206. line: '</person >',
  207. tokens: [
  208. { startIndex: 0, type: 'delimiter.end.xml' },
  209. { startIndex: 2, type: 'tag.tag-person.xml' },
  210. { startIndex: 8, type: '' },
  211. { startIndex: 10, type: 'delimiter.end.xml' }
  212. ]}],
  213. // Incomplete End Tag
  214. [{
  215. line: '</person',
  216. tokens: [
  217. { startIndex: 0, type: '' }
  218. ]}],
  219. // Comments
  220. [{
  221. line: '<!-- -->',
  222. tokens: [
  223. { startIndex: 0, type: 'comment.xml' },
  224. { startIndex: 4, type: 'comment.content.xml' },
  225. { startIndex: 5, type: 'comment.xml' }
  226. ]}],
  227. [{
  228. line: '<!--a>monaco</a -->',
  229. tokens: [
  230. { startIndex: 0, type: 'comment.xml' },
  231. { startIndex: 4, type: 'comment.content.xml' },
  232. { startIndex: 16, type: 'comment.xml' }
  233. ]}],
  234. [{
  235. line: '<!--a>',
  236. tokens: [
  237. { startIndex: 0, type: 'comment.xml' },
  238. { startIndex: 4, type: 'comment.content.xml' }
  239. ]},{
  240. line: 'monaco ',
  241. tokens: [
  242. { startIndex: 0, type: 'comment.content.xml' }
  243. ]},{
  244. line: 'tools</a -->',
  245. tokens: [
  246. { startIndex: 0, type: 'comment.content.xml' },
  247. { startIndex: 9, type: 'comment.xml' }
  248. ]}],
  249. // CDATA
  250. [{
  251. line: '<tools><![CDATA[<person/>]]></tools>',
  252. tokens: [
  253. { startIndex: 0, type: 'delimiter.start.xml' },
  254. { startIndex: 1, type: 'tag.tag-tools.xml' },
  255. { startIndex: 6, type: 'delimiter.start.xml' },
  256. { startIndex: 7, type: 'delimiter.cdata.xml' },
  257. { startIndex: 16, type: '' },
  258. { startIndex: 25, type: 'delimiter.cdata.xml' },
  259. { startIndex: 28, type: 'delimiter.end.xml' },
  260. { startIndex: 30, type: 'tag.tag-tools.xml' },
  261. { startIndex: 35, type: 'delimiter.end.xml' }
  262. ]}],
  263. [{
  264. line: '<tools>',
  265. tokens: [
  266. { startIndex: 0, type: 'delimiter.start.xml' },
  267. { startIndex: 1, type: 'tag.tag-tools.xml' },
  268. { startIndex: 6, type: 'delimiter.start.xml' }
  269. ]},{
  270. line: '\t<![CDATA[',
  271. tokens: [
  272. { startIndex: 0, type: '' },
  273. { startIndex: 1, type: 'delimiter.cdata.xml' }
  274. ]},{
  275. line: '\t\t<person/>',
  276. tokens: [
  277. { startIndex: 0, type: '' }
  278. ]},{
  279. line: '\t]]>',
  280. tokens: [
  281. { startIndex: 0, type: '' },
  282. { startIndex: 1, type: 'delimiter.cdata.xml' },
  283. ]},{
  284. line: '</tools>',
  285. tokens: [
  286. { startIndex: 0, type: 'delimiter.end.xml' },
  287. { startIndex: 2, type: 'tag.tag-tools.xml' },
  288. { startIndex: 7, type: 'delimiter.end.xml' }
  289. ]}],
  290. // Generated from sample
  291. [{
  292. line: '<?xml version="1.0"?>',
  293. tokens: [
  294. { startIndex: 0, type: 'delimiter.start.xml' },
  295. { startIndex: 2, type: 'metatag.instruction.xml' },
  296. { startIndex: 5, type: '' },
  297. { startIndex: 6, type: 'attribute.name.xml' },
  298. { startIndex: 13, type: '' },
  299. { startIndex: 14, type: 'attribute.value.xml' },
  300. { startIndex: 19, type: 'delimiter.start.xml' }
  301. ]}, {
  302. line: '<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">',
  303. tokens: [
  304. { startIndex: 0, type: 'delimiter.start.xml' },
  305. { startIndex: 1, type: 'tag.tag-configuration.xml' },
  306. { startIndex: 14, type: '' },
  307. { startIndex: 15, type: 'attribute.name.xml' },
  308. { startIndex: 24, type: '' },
  309. { startIndex: 25, type: 'attribute.value.xml' },
  310. { startIndex: 78, type: 'delimiter.start.xml' }
  311. ]}, {
  312. line: ' <connectionStrings>',
  313. tokens: [
  314. { startIndex: 0, type: '' },
  315. { startIndex: 2, type: 'delimiter.start.xml' },
  316. { startIndex: 3, type: 'tag.tag-connectionstrings.xml' },
  317. { startIndex: 20, type: 'delimiter.start.xml' }
  318. ]}, {
  319. line: ' <add name="MyDB" ',
  320. tokens: [
  321. { startIndex: 0, type: '' },
  322. { startIndex: 4, type: 'delimiter.start.xml' },
  323. { startIndex: 5, type: 'tag.tag-add.xml' },
  324. { startIndex: 8, type: '' },
  325. { startIndex: 9, type: 'attribute.name.xml' },
  326. { startIndex: 13, type: '' },
  327. { startIndex: 14, type: 'attribute.value.xml' },
  328. { startIndex: 20, type: '' }
  329. ]}, {
  330. line: ' connectionString="value for the deployed Web.config file" ',
  331. tokens: [
  332. { startIndex: 0, type: '' },
  333. { startIndex: 6, type: 'attribute.name.xml' },
  334. { startIndex: 22, type: '' },
  335. { startIndex: 23, type: 'attribute.value.xml' },
  336. { startIndex: 63, type: '' }
  337. ]}, {
  338. line: ' xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>',
  339. tokens: [
  340. { startIndex: 0, type: '' },
  341. { startIndex: 6, type: 'attribute.name.xml' },
  342. { startIndex: 19, type: '' },
  343. { startIndex: 20, type: 'attribute.value.xml' },
  344. { startIndex: 35, type: '' },
  345. { startIndex: 36, type: 'attribute.name.xml' },
  346. { startIndex: 47, type: '' },
  347. { startIndex: 48, type: 'attribute.value.xml' },
  348. { startIndex: 61, type: 'tag.tag-add.xml' },
  349. { startIndex: 62, type: 'delimiter.start.xml' }
  350. ]}, {
  351. line: ' </connectionStrings>',
  352. tokens: [
  353. { startIndex: 0, type: '' },
  354. { startIndex: 2, type: 'delimiter.end.xml' },
  355. { startIndex: 4, type: 'tag.tag-connectionstrings.xml' },
  356. { startIndex: 21, type: 'delimiter.end.xml' }
  357. ]}, {
  358. line: ' <system.web>',
  359. tokens: [
  360. { startIndex: 0, type: '' },
  361. { startIndex: 2, type: 'delimiter.start.xml' },
  362. { startIndex: 3, type: 'tag.tag-system.web.xml' },
  363. { startIndex: 13, type: 'delimiter.start.xml' }
  364. ]}, {
  365. line: ' <customErrors defaultRedirect="GenericError.htm"',
  366. tokens: [
  367. { startIndex: 0, type: '' },
  368. { startIndex: 4, type: 'delimiter.start.xml' },
  369. { startIndex: 5, type: 'tag.tag-customerrors.xml' },
  370. { startIndex: 17, type: '' },
  371. { startIndex: 18, type: 'attribute.name.xml' },
  372. { startIndex: 33, type: '' },
  373. { startIndex: 34, type: 'attribute.value.xml' }
  374. ]}, {
  375. line: ' mode="RemoteOnly" xdt:Transform="Replace">',
  376. tokens: [
  377. { startIndex: 0, type: '' },
  378. { startIndex: 6, type: 'attribute.name.xml' },
  379. { startIndex: 10, type: '' },
  380. { startIndex: 11, type: 'attribute.value.xml' },
  381. { startIndex: 23, type: '' },
  382. { startIndex: 24, type: 'attribute.name.xml' },
  383. { startIndex: 37, type: '' },
  384. { startIndex: 38, type: 'attribute.value.xml' },
  385. { startIndex: 47, type: 'delimiter.start.xml' }
  386. ]}, {
  387. line: ' <error statusCode="500" redirect="InternalError.htm"/>',
  388. tokens: [
  389. { startIndex: 0, type: '' },
  390. { startIndex: 6, type: 'delimiter.start.xml' },
  391. { startIndex: 7, type: 'tag.tag-error.xml' },
  392. { startIndex: 12, type: '' },
  393. { startIndex: 13, type: 'attribute.name.xml' },
  394. { startIndex: 23, type: '' },
  395. { startIndex: 24, type: 'attribute.value.xml' },
  396. { startIndex: 29, type: '' },
  397. { startIndex: 30, type: 'attribute.name.xml' },
  398. { startIndex: 38, type: '' },
  399. { startIndex: 39, type: 'attribute.value.xml' },
  400. { startIndex: 58, type: 'tag.tag-error.xml' },
  401. { startIndex: 59, type: 'delimiter.start.xml' }
  402. ]}, {
  403. line: ' </customErrors>',
  404. tokens: [
  405. { startIndex: 0, type: '' },
  406. { startIndex: 4, type: 'delimiter.end.xml' },
  407. { startIndex: 6, type: 'tag.tag-customerrors.xml' },
  408. { startIndex: 18, type: 'delimiter.end.xml' }
  409. ]}, {
  410. line: ' </system.web>',
  411. tokens: [
  412. { startIndex: 0, type: '' },
  413. { startIndex: 2, type: 'delimiter.end.xml' },
  414. { startIndex: 4, type: 'tag.tag-system.web.xml' },
  415. { startIndex: 14, type: 'delimiter.end.xml' }
  416. ]}, {
  417. line: ' ',
  418. tokens: [
  419. { startIndex: 0, type: '' }
  420. ]}, {
  421. line: ' <!-- The stuff below was added for extra tokenizer testing -->',
  422. tokens: [
  423. { startIndex: 0, type: '' },
  424. { startIndex: 1, type: 'comment.xml' },
  425. { startIndex: 5, type: 'comment.content.xml' },
  426. { startIndex: 60, type: 'comment.xml' }
  427. ]}, {
  428. line: ' <!-- A multi-line comment <with> </with>',
  429. tokens: [
  430. { startIndex: 0, type: '' },
  431. { startIndex: 1, type: 'comment.xml' },
  432. { startIndex: 5, type: 'comment.content.xml' }
  433. ]}, {
  434. line: ' <tags>',
  435. tokens: [
  436. { startIndex: 0, type: 'comment.content.xml' }
  437. ]}, {
  438. line: ' -->',
  439. tokens: [
  440. { startIndex: 0, type: 'comment.content.xml' },
  441. { startIndex: 5, type: 'comment.xml' }
  442. ]}, {
  443. line: ' <!DOCTYPE another meta tag>',
  444. tokens: [
  445. { startIndex: 0, type: '' },
  446. { startIndex: 1, type: 'delimiter.start.xml' },
  447. { startIndex: 3, type: 'metatag.declaration.xml' },
  448. { startIndex: 10, type: '' },
  449. { startIndex: 11, type: 'attribute.name.xml' },
  450. { startIndex: 18, type: '' },
  451. { startIndex: 19, type: 'attribute.name.xml' },
  452. { startIndex: 23, type: '' },
  453. { startIndex: 24, type: 'attribute.name.xml' },
  454. { startIndex: 27, type: 'delimiter.start.xml' }
  455. ]}, {
  456. line: ' <tools><![CDATA[Some text and tags <person/>]]></tools>',
  457. tokens: [
  458. { startIndex: 0, type: '' },
  459. { startIndex: 1, type: 'delimiter.start.xml' },
  460. { startIndex: 2, type: 'tag.tag-tools.xml' },
  461. { startIndex: 7, type: 'delimiter.start.xml' },
  462. { startIndex: 8, type: 'delimiter.cdata.xml' },
  463. { startIndex: 17, type: '' },
  464. { startIndex: 45, type: 'delimiter.cdata.xml' },
  465. { startIndex: 48, type: 'delimiter.end.xml' },
  466. { startIndex: 50, type: 'tag.tag-tools.xml' },
  467. { startIndex: 55, type: 'delimiter.end.xml' }
  468. ]}, {
  469. line: ' <aSelfClosingTag with="attribute" />',
  470. tokens: [
  471. { startIndex: 0, type: '' },
  472. { startIndex: 1, type: 'delimiter.start.xml' },
  473. { startIndex: 2, type: 'tag.tag-aselfclosingtag.xml' },
  474. { startIndex: 17, type: '' },
  475. { startIndex: 18, type: 'attribute.name.xml' },
  476. { startIndex: 22, type: '' },
  477. { startIndex: 23, type: 'attribute.value.xml' },
  478. { startIndex: 34, type: '' },
  479. { startIndex: 35, type: 'tag.tag-aselfclosingtag.xml' },
  480. { startIndex: 36, type: 'delimiter.start.xml' }
  481. ]}, {
  482. line: ' <aSelfClosingTag with="attribute"/>',
  483. tokens: [
  484. { startIndex: 0, type: '' },
  485. { startIndex: 1, type: 'delimiter.start.xml' },
  486. { startIndex: 2, type: 'tag.tag-aselfclosingtag.xml' },
  487. { startIndex: 17, type: '' },
  488. { startIndex: 18, type: 'attribute.name.xml' },
  489. { startIndex: 22, type: '' },
  490. { startIndex: 23, type: 'attribute.value.xml' },
  491. { startIndex: 34, type: 'tag.tag-aselfclosingtag.xml' },
  492. { startIndex: 35, type: 'delimiter.start.xml' }
  493. ]}, {
  494. line: ' <namespace:aSelfClosingTag otherspace:with="attribute"/>',
  495. tokens: [
  496. { startIndex: 0, type: '' },
  497. { startIndex: 1, type: 'delimiter.start.xml' },
  498. { startIndex: 2, type: 'tag.tag-namespace:aselfclosingtag.xml' },
  499. { startIndex: 27, type: '' },
  500. { startIndex: 28, type: 'attribute.name.xml' },
  501. { startIndex: 43, type: '' },
  502. { startIndex: 44, type: 'attribute.value.xml' },
  503. { startIndex: 55, type: 'tag.tag-namespace:aselfclosingtag.xml' },
  504. { startIndex: 56, type: 'delimiter.start.xml' }
  505. ]}, {
  506. line: ' <valid-name also_valid this.one=\'too is valid\'/>',
  507. tokens: [
  508. { startIndex: 0, type: '' },
  509. { startIndex: 1, type: 'delimiter.start.xml' },
  510. { startIndex: 2, type: 'tag.tag-valid-name.xml' },
  511. { startIndex: 12, type: '' },
  512. { startIndex: 13, type: 'attribute.name.xml' },
  513. { startIndex: 23, type: '' },
  514. { startIndex: 24, type: 'attribute.name.xml' },
  515. { startIndex: 32, type: '' },
  516. { startIndex: 33, type: 'attribute.value.xml' },
  517. { startIndex: 47, type: 'tag.tag-valid-name.xml' },
  518. { startIndex: 48, type: 'delimiter.start.xml' }
  519. ]}, {
  520. line: ' <aSimpleSelfClosingTag />',
  521. tokens: [
  522. { startIndex: 0, type: '' },
  523. { startIndex: 1, type: 'delimiter.start.xml' },
  524. { startIndex: 2, type: 'tag.tag-asimpleselfclosingtag.xml' },
  525. { startIndex: 23, type: '' },
  526. { startIndex: 24, type: 'tag.tag-asimpleselfclosingtag.xml' },
  527. { startIndex: 25, type: 'delimiter.start.xml' }
  528. ]}, {
  529. line: ' <aSimpleSelfClosingTag/>',
  530. tokens: [
  531. { startIndex: 0, type: '' },
  532. { startIndex: 1, type: 'delimiter.start.xml' },
  533. { startIndex: 2, type: 'tag.tag-asimpleselfclosingtag.xml' },
  534. { startIndex: 24, type: 'delimiter.start.xml' }
  535. ]}, {
  536. line: '</configuration>',
  537. tokens: [
  538. { startIndex: 0, type: 'delimiter.end.xml' },
  539. { startIndex: 2, type: 'tag.tag-configuration.xml' },
  540. { startIndex: 15, type: 'delimiter.end.xml' }
  541. ]}]
  542. ]);