HTML output from XLS file and XML feed

jesperhp used Ask the Experts™
I have a XML feed from a mediaservice, which I would like to show nicely on our web-page. I also have a standard XLS file from the mediaservice, but I'm not that into XLS etc to know exactly how to load the feed along with the stylesheet, and get it shown nicely.

I have full access to change everything in the XLS or greate HTML files, but I dont have access to change the XML feed.

The XML feed is retreived from this location:

The style is shown below:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="" version="1.0">
<xsl:output method="html" encoding="iso-8859-1"/>

<xsl:template match="/feeds">
     body     { color: #000000; background-color: #ffffff; }
     H2 {font-size: 13pt; font-family: Arial;}
     a:link   {color: #006c43}
     a:visited{color: #006c43;}
     a:hover  {color: gray;}
     .date  {font-size: 9pt; font-family: Arial;}
     .source  {font-size: 9pt; font-family: Arial;}
     .title  {font-size: 10pt; font-family: Arial; color: #006c43; text-decoration: underline;}
     .ingress {font-size: 10pt; font-style: italic; font-family: Times;}
     .match {font-size: 10pt; font-style: italic; font-family: Verdana, arial, sans-serif;}
     .title a:link {font-size: 10pt; font-family: Arial; color: #006c43; text-decoration: underline;}
     .title a:visited{color: #006c43;}
     .title a:hover  {color: gray;}

<xsl:template match="feed">
 <h2><xsl:value-of select="name"/></h2>
 <table border="0">
   <xsl:for-each select="documents/document">
     <xsl:if test="(alike&lt;2 or docId=alike)">
         <td nowrap="" valign="top">
           <span class="date"><xsl:value-of select="createDate2"/>,</span> <span class="source"><xsl:value-of select="sourcename"/></span>
           <div class="title">
               <xsl:attribute name="href"><xsl:value-of select="url"/></xsl:attribute>
               <xsl:attribute name="target">_blank</xsl:attribute>
               <xsl:value-of select="title2"/>
           <span class="ingress"><xsl:value-of select="ingress"/></span>

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
All you need to do is add this in the top part of your XML:

<?xml-stylesheet type-"text/xs1" href-" URL TO XSL GOES HERE  "?>


Thanks - but the problem is, that I can not edit the XML, only the XSL. The XML document is a standard feed from a media service.

I hope it makes sense :-)
In that case I don't think it's possible to apply a stylesheet to the xml feed.

XML isn't used to display content anyway, it's used to create a feed.
What I would suggest is creating a simple php page that reads your feed and outputs html/CSS.
After all, that's how you're supposed to work. :)

You can use simpleXML to do this, preety straightforward:
just read in the xml file, and display the info ( childnodes ) you want.

Thanks for the suggestions. I ended up using to solve the problem.



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial