Skip to content

How to include a xsl stylesheet? #44

Description

@marcofranssen

I am trying to include my xsl stylesheet but somehow it doesn't work.

My code:

xml(
    {
      "?xml-stylesheet": [{ _attr: { type: "text/xsl", href: "sitemap.xsl" } }],
      sitemapindex: [
        { _attr: { xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9" } },
        { sitemap: [
          { loc: "https://nextjs.marcofranssen.nl/blog-sitemap.xml" }, 
          { lastmod: new Date().toISOString() },
        ]
      ],
    },
    { declaration: true }
)

Result:

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="sitemap.xsl"></?xml-stylesheet>

Expected:

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://nextjs.marcofranssen.nl/blog-sitemap.xml</loc>
    <lastmod>2021-01-24T12:55:02.245Z</lastmod>
  </sitemap>
</sitemapindex>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions