Closed kbond closed 10 years ago
What about now? Didn't validate, but just parsed the results and use defaults if not correct.
What about now? Didn't validate, but just parsed the results and use defaults if not correct.
I like that. What about naming it normalizeLastMod'
and include assigning the defaults instead of returning null?
I renamed all three of the static methods to normalize*
For normalizeLastMod
, the default is null
according to the sitemap protocol.
Cool. I like. Ready to merge?
Almost, I want to fix the tests first. Will work on that today.
Ok, I think this is good to merge now.
Hm. Another idea: What about adding those normalize methods to the interface and adding an abstract generator class that implements the interface for convenience? This way they (the normalize methods) could be invoked on generate() calls and thus entries assigned to the template are safe i.e. no need to check for defaults in templates.
Ok, I'll merge this one and open a new PR for further discussion.
Ok, yeah, I will probably need an example.
Ok, yeah, I will probably need an example.
See #24 ;)
Here is the start of my idea for a 2.0 refactor (ref #20)
Let me know what you think.
TODO: