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

Check if Sitemap is Valid? #19

Open
coderingo opened this issue Feb 8, 2017 · 3 comments
Open

Check if Sitemap is Valid? #19

coderingo opened this issue Feb 8, 2017 · 3 comments

Comments

@coderingo
Copy link

Hi,

Thanks for the great library and I think its the only nodejs sitemap parser which is upto date. I was wondering is there any way to check whether the sitemap is having valid syntax?
I basically needs a validator for sitemap but I am sure that this parser will be already using rules for the schema of sitemap. So does it throws any errors on detecting invalid syntax or is it forgiving?

I am happy to help and submit a PR if that can be implemented using the code already in place.

Kind Regards

@seantomburke
Copy link
Owner

I've never tried it on invalid site maps, if you can create a PR with a test, I'd be happy to merge it

@coderingo
Copy link
Author

Hi @hawaiianchimp

Since the time I have submitted the issue, I have been researching on the solutions for my own problem as well. As sitemap is xml so it can be validate against xsd formats and sitemaps.org provides two xsd files, one for sitemap's index and one for the actual sitemap. (E.g https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd)

Libraries like xml.js provides the utility to validate xml files against xsd. I am not sure whether it should still be incorporated in the sitemapper or not? Will love to hear your thoughts/decision on it

@seantomburke
Copy link
Owner

I haven't come across an invalid sitemap yet, so I'm not sure how important this is. I'm sure it would be useful for others, in the case that the process crashes in the event of an invalid sitemap.

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

No branches or pull requests

2 participants