node-rss icon indicating copy to clipboard operation
node-rss copied to clipboard

Ability to add a stylesheet

Open lolmaus opened this issue 8 years ago • 1 comments
trafficstars

https://www.petefreitag.com/item/208.cfm

<?xml version="1.0" ?>
<?xml-stylesheet type="text/css" href="http://you.com/rss.css" ?>
...

lolmaus avatar Dec 27 '16 01:12 lolmaus

@lolmaus, and anyone looking for a workaround – try this:

const feed = new RSS({
  /* config */
});

const response = feed.xml().replace(
    `<?xml version="1.0" encoding="UTF-8"?>`,
    `<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/pretty-feed-v3.xsl" type="text/xsl"?>`
)
console.log(response)

This response will now contain a reference to stylesheet (XSL).

Here's a great template for getting started.

dustinlarimer avatar Nov 07 '23 23:11 dustinlarimer