Specifying an XSL doc in c# web service 
Author Message
 Specifying an XSL doc in c# web service

Hey
So now I have my web service giving my my data in xml and I can see it
in IE - See below. Can I specify an XSL document in the xml header so
that I can see it in a pretty HTML table, processed on the client
side? Where in Visual Studio do I specify this parameter? And what
would the XSL document look like?

Thanks
Patrick

<?xml version="1.0" encoding="utf-8" ?>
- <outputClass xmlns:xsd=" http://www.*-*-*.com/ ;
xmlns:xsi=" http://www.*-*-*.com/ ;
xmlns=" http://www.*-*-*.com/ ;>
- <employees>
- <employee>
  <name>Patrick Jones</employee>
  <id>80</id>
  <salary>(syn-secondary)</salary>
  </employee>
 </employees>



Tue, 10 May 2005 23:52:06 GMT  
 Specifying an XSL doc in c# web service
Patrick,

    You can modify the XML to place the following processing instruction
into your XML:
<?xml:stylesheet type="text/xsl" href="yourTransform.xsl"?>    This will
cause the XML to be rendered correctly according to the document outlined in
the href attribute.    Hope this helps.--                - Nicholas Paldino


Quote:
> Hey
> So now I have my web service giving my my data in xml and I can see it
> in IE - See below. Can I specify an XSL document in the xml header so
> that I can see it in a pretty HTML table, processed on the client
> side? Where in Visual Studio do I specify this parameter? And what
> would the XSL document look like?

> Thanks
> Patrick

> <?xml version="1.0" encoding="utf-8" ?>
> - <outputClass xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://tempuri.org/">
> - <employees>
> - <employee>
>   <name>Patrick Jones</employee>
>   <id>80</id>
>   <salary>(syn-secondary)</salary>
>   </employee>
>  </employees>



Tue, 10 May 2005 23:55:27 GMT  
 Specifying an XSL doc in c# web service
Put this line:
<?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>

right after the version declaration in your xml. When you view it in
the browser, it should (if its xml-compliant) transform it for you.

chris

Quote:

> Hey
> So now I have my web service giving my my data in xml and I can see it
> in IE - See below. Can I specify an XSL document in the xml header so
> that I can see it in a pretty HTML table, processed on the client
> side? Where in Visual Studio do I specify this parameter? And what
> would the XSL document look like?

> Thanks
> Patrick

> <?xml version="1.0" encoding="utf-8" ?>
> - <outputClass xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://tempuri.org/">
> - <employees>
> - <employee>
>   <name>Patrick Jones</employee>
>   <id>80</id>
>   <salary>(syn-secondary)</salary>
>   </employee>
>  </employees>



Wed, 11 May 2005 03:38:19 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Visual C++ Web Service & ASP Web Controls

2. Output types for web methods in c# web service

3. Deploying web applications with a web service

4. Namespace Conflict - c# Class Library used by Web Service and ASP.NET Web App

5. ATL Server - Web Application/Web Service

6. Web Service with existing web server

7. Can not access web service from C# Windows Service

8. Windows Service (not a web service) question

9. Is .doc to .tif possible in web environment

10. How does Web browser select ActiveX doc server?

11. VC++ COM Windows Service returns "The specified service does not exist as an installed service" error

12. ATL Server Web Service vs. Managed C++ Web Service

 

 
Powered by phpBB® Forum Software