Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leading whitespace in sitemaps isn't stripped #491

Open
JustAnotherArchivist opened this issue Nov 30, 2024 · 0 comments
Open

Leading whitespace in sitemaps isn't stripped #491

JustAnotherArchivist opened this issue Nov 30, 2024 · 0 comments
Labels

Comments

@JustAnotherArchivist
Copy link
Contributor

wpull does not strip the leading whitespace between the opening <loc> and the actual location, thus constructing a relative URL with spaces instead. The trailing whitespace is getting stripped. ArchiveBot job 72ckueskvsyzq8444tfso85g0 extracted URLs like https://www.windband.ch/%20%20%20%20%20%20%20%20%20%20%20%20https:/windband.ch/angebot from the following https://www.windband.ch/sitemap.xml:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <url>
        <loc>
            https://windband.ch
        </loc>
        <xhtml:link rel="alternate" hreflang="fr" href="https://windband.ch/fr"/>
        <xhtml:link rel="alternate" hreflang="it" href="https://windband.ch/it"/>
        <xhtml:link rel="alternate" hreflang="de-CH" href="https://windband.ch"/>
        <xhtml:link rel="alternate" hreflang="x-default" href="https://windband.ch"/>
    </url>
    <url>
        <loc>
            https://windband.ch/angebot
        </loc>
        <xhtml:link rel="alternate" hreflang="fr" href="https://windband.ch/fr/angebot"/>
        <xhtml:link rel="alternate" hreflang="it" href="https://windband.ch/it/angebot"/>
        <xhtml:link rel="alternate" hreflang="de-CH" href="https://windband.ch/angebot"/>
        <xhtml:link rel="alternate" hreflang="x-default" href="https://windband.ch/angebot"/>
    </url>
...

This has happened on other ArchiveBot jobs before. (Side note, the extra <xhtml:link> are not getting extracted.)

It's worth mentioning that XML parsers must pass the whitespace through and that, while there is no solid standard on the sitemap.xml format, the closest thing makes no mention of whitespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant