0

I have a WCF service that uses a System.ServiceModel.Syndication.SyndicationFeed to create an RSS feed.

But I'm having trouble figuring out how to add a Processing Instruction to output that points to my CSS stylesheet.

What I need is a processing instruction that looks a bit like this:

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

Anyone have a hint how you add that using SyndicationFeed ?

1

2 Answers 2

1

Since your contract is going to return an instance of SyndicationFeedFormatter, which implements IXmlSerializable, I would have your method on the service contract get that instance, then call the methods on IXmlSerializable to serialize the output to XML. You can then add the processing instruction to the XML (XDocument, or XmlDocument) and then pass those contents back.

Sign up to request clarification or add additional context in comments.

Comments

1

I am not familiar with WCF, but I found this. I think this might help you out.

http://www.developmentnow.com/g/8_2008_2_0_0_1041398/xslt-and-System-ServiceModel-Syndication.htm

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.