Closed ianfoxofficial closed 8 years ago
Nope, not yet. We can try to create one if you want to work on it.
Wold be really interested in a solution here. Do you have any idea yet on how/where you want to implement it?
XmlSerializer class handles the serialization.
What's the purpose of XSLT transformation exactly? Do you intend the change to output? It's defined on the protocol already.
I also have to inform you that I'm working on a new version that will only support ASP.NET Core Mvc. Do you think the changes you need would also work on .NET Core?
The purpose was to show humans a prettier sitemap when they visit it.
In the meanwhile I've built a separate "Human Sitemap" instead with the titles of the pages and items which I link to in the pages.
For me it would be nice if you can implement it.
As I understand its just a line which appears bellow the following:
<?xml version="1.0" encoding="UTF-8"?>
.
This one would be needed:
<?xml-stylesheet type="text/xsl" href="//www.icrossing.com/sitemap.xsl"?>
Perhaps you need to adjust the namespaces according to:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
Finally i think there should be nothing more than a property or something else where the url to the .xls can be set.
For the purpose I agree with @ianfoxofficial so it can be viewed easy as a human. I would love to see the feature, so there would be no redundant code and a standard would be followed.
The implementation can be done similar to the approach @spartanier7777 suggested.
@uhaciogullari I think it would be nice to support it in your current version too, not only in ASP.NET Core, if that would be possible.
@Michu44 We can certainly implement it in the current version.
@spartanier7777 I can handle the namespaces but what would be the input? Just a list of stylesheet URLs? If you could create the models I can try to inject them like explained here.
@uhaciogullari in my opinion it's nothing more than a string (url), which goes into the href of this code:
<?xml-stylesheet type="text/xsl" href="//www.icrossing.com/sitemap.xsl"?>
This url points to a controller action which returns the xls. This would be my idea of the implementation. By the namespaces I posted I'm not 100% sure if those are needed for the .xsl implementation. Maybe the current namespaces does it also.
EDIT: According to the link you posted, I think there should be nothing more to do as:
pages_XML.WriteProcessingInstruction("xml-stylesheet", "type='text/xsl' href='gss.xsl'");
where gss.xsl could be a property or a parameter which can be passsed.
Ok. I'll work on this one. Let's see if I can add it without a breaking change.
@uhaciogullari I agree with @spartanier7777, a simple string overload would already be enough. When you need anything just hit me up.
Actually if you have an existing xml stylesheet, that will be useful.
@uhaciogullari
You can find an example here: http://www.icrossing.com/sitemap.xml
the according xsl to it: http://www.icrossing.com/sitemap.xsl
I have not created one of my own yet, but maybe these might help you, I would be building on something like this at least.
https://yoast.com/xsl-stylesheet-xml-sitemap/
Or the one @spartanier7777 provided in his example above: http://www.icrossing.com/sitemap.xml http://www.icrossing.com/sitemap.xsl
Edit: @spartanier7777 was faster, sorry :)
I pushed a beta version of v3. It contains the support for XSL style sheets. Please try it and see if we are missing something.
@uhaciogullari Tested and works! Please create asap a release version, that we can deploy your package on our prod env.
thanks 👍
I pushed v3.
Cheers
Is there a way to attach an XSLT template to the output? I can't find anything on that. Thnx.