File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,40 @@ test("`parse()` xml syntax xml stylesheet", () =>
256
256
} ,
257
257
) )
258
258
259
+ test ( "`parse()` xml syntax xml stylesheet (sitemap.xml example)" , ( ) => {
260
+ expect (
261
+ parse ( `
262
+ <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
263
+ <?xml-stylesheet type="text/xsl" href="sitemap-style.xml" ?>
264
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
265
+ <url>
266
+ <loc>https://example.com</loc>
267
+ <lastmod>2025-05-30T03:50:28-04:00</lastmod>
268
+ </url>
269
+ </urlset>` ) ,
270
+ ) . toEqual (
271
+ {
272
+ "#instructions" : {
273
+ "xml-stylesheet" : {
274
+ "@href" : "sitemap-style.xml" ,
275
+ "@type" : "text/xsl" ,
276
+ } ,
277
+ } ,
278
+ "@encoding" : "utf-8" ,
279
+ "@standalone" : "yes" ,
280
+ "@version" : "1.0" ,
281
+ urlset : {
282
+ "@xmlns" : "http://www.sitemaps.org/schemas/sitemap/0.9" ,
283
+ "@xmlns:xhtml" : "http://www.w3.org/1999/xhtml" ,
284
+ url : {
285
+ lastmod : "2025-05-30T03:50:28-04:00" ,
286
+ loc : "https://example.com" ,
287
+ } ,
288
+ } ,
289
+ } ,
290
+ )
291
+ } )
292
+
259
293
test ( "`parse()` xml syntax doctype" , ( ) =>
260
294
expect (
261
295
parse (
You can’t perform that action at this time.
0 commit comments