XSLT outputs plain text

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have this xml document

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <?<span style="color:#A31515; xml <span style="color:Red; version<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; 1.0<span style="color:Black; <span style="color:Red; encoding<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; UTF-8<span style="color:Black; <span style="color:Blue; ?><span style="color:Blue; <?<span style="color:#A31515; xml-stylesheet<span style="color:Gray; href="http://www.blogger.com/styles/atom.css" type="text/css"<span style="color:Blue; ?><span style="color:Blue; <<span style="color:#A31515; feed <span style="color:Red; xmlns<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://www.w3.org/2005/Atom<span style="color:Black; <span style="color:Red; xmlns:openSearch<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://a9.com/-/spec/opensearchrss/1.0/<span style="color:Black; <span style="color:Red; xmlns:georss<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://www.georss.org/georss<span style="color:Black; <span style="color:Red; xmlns:thr<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://purl.org/syndication/thread/1.0<span style="color:Black; <span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; id<span style="color:Blue; >tag:blogger.com,1999:blog-8969348366993936914<span style="color:Blue; </<span style="color:#A31515; id<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; updated<span style="color:Blue; >2010-12-27T13:17:42.887-08:00<span style="color:Blue; </<span style="color:#A31515; updated<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; title <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; text<span style="color:Black; <span style="color:Blue; >Team #1334 Robotics<span style="color:Blue; </<span style="color:#A31515; title<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; subtitle <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; html<span style="color:Black; <span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; subtitle<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://schemas.google.com/g/2005#feed<span style="color:Black; <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; application/atom+xml<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://othsrobotics.blogspot.com/feeds/posts/default<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; self<span style="color:Black; <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; application/atom+xml<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://www.blogger.com/feeds/8969348366993936914/posts/default<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; alternate<span style="color:Black; <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; text/html<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://othsrobotics.blogspot.com/<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; hub<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://pubsubhubbub.appspot.com/<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; author<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; name<span style="color:Blue; >OTHS Robotics<span style="color:Blue; </<span style="color:#A31515; name<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; uri<span style="color:Blue; >http://www.blogger.com/profile/12343885763233322609<span style="color:Blue; </<span style="color:#A31515; uri<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; email<span style="color:Blue; >noreply@blogger.com<span style="color:Blue; </<span style="color:#A31515; email<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; author<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; generator <span style="color:Red; version<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; 7.00<span style="color:Black; <span style="color:Red; uri<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://www.blogger.com<span style="color:Black; <span style="color:Blue; >Blogger<span style="color:Blue; </<span style="color:#A31515; generator<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; openSearch<span style="color:Blue; :<span style="color:#A31515; totalResults<span style="color:Blue; >1<span style="color:Blue; </<span style="color:#A31515; openSearch<span style="color:Blue; :<span style="color:#A31515; totalResults<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; openSearch<span style="color:Blue; :<span style="color:#A31515; startIndex<span style="color:Blue; >1<span style="color:Blue; </<span style="color:#A31515; openSearch<span style="color:Blue; :<span style="color:#A31515; startIndex<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; openSearch<span style="color:Blue; :<span style="color:#A31515; itemsPerPage<span style="color:Blue; >25<span style="color:Blue; </<span style="color:#A31515; openSearch<span style="color:Blue; :<span style="color:#A31515; itemsPerPage<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; entry<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; id<span style="color:Blue; >tag:blogger.com,1999:blog-8969348366993936914.post-226718910625225131<span style="color:Blue; </<span style="color:#A31515; id<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; published<span style="color:Blue; >2010-12-20T15:08:00.001-08:00<span style="color:Blue; </<span style="color:#A31515; published<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; updated<span style="color:Blue; >2010-12-20T17:29:32.595-08:00<span style="color:Blue; </<span style="color:#A31515; updated<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; title <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; text<span style="color:Black; <span style="color:Blue; >Test Post<span style="color:Blue; </<span style="color:#A31515; title<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; content <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; html<span style="color:Black; <span style="color:Blue; >This is just a test<span style="color:Red; &lt;br /<span style="color:Red; &gt;<span style="color:Red; &lt;br /<span style="color:Red; &gt;....<span style="color:Red; &lt;div class="blogger-post-footer"<span style="color:Red; &gt;<span style="color:Red; &lt;img width=1 height=1 src=https://blogger.googleusercontent.com/tracker/8969348366993936914-226718910625225131?l=othsrobotics.blogspot.com alt= /<span style="color:Red; &gt;<span style="color:Red; &lt;/div<span style="color:Red; &gt;<span style="color:Blue; </<span style="color:#A31515; content<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; replies<span style="color:Black; <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; application/atom+xml<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://othsrobotics.blogspot.com/feeds/226718910625225131/comments/default<span style="color:Black; <span style="color:Red; title<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; Post Comments<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; replies<span style="color:Black; <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; text/html<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://othsrobotics.blogspot.com/2010/12/test-post.html#comment-form<span style="color:Black; <span style="color:Red; title<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; 0 Comments<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; edit<span style="color:Black; <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; application/atom+xml<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://www.blogger.com/feeds/8969348366993936914/posts/default/226718910625225131<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; self<span style="color:Black; <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; application/atom+xml<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://www.blogger.com/feeds/8969348366993936914/posts/default/226718910625225131<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; link <span style="color:Red; rel<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; alternate<span style="color:Black; <span style="color:Red; type<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; text/html<span style="color:Black; <span style="color:Red; href<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://othsrobotics.blogspot.com/2010/12/test-post.html<span style="color:Black; <span style="color:Red; title<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; Test Post<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; <<span style="color:#A31515; author<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; name<span style="color:Blue; >OTHS Robotics<span style="color:Blue; </<span style="color:#A31515; name<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; uri<span style="color:Blue; >http://www.blogger.com/profile/12343885763233322609<span style="color:Blue; </<span style="color:#A31515; uri<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; email<span style="color:Blue; >noreply@blogger.com<span style="color:Blue; </<span style="color:#A31515; email<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; gd<span style="color:Blue; :<span style="color:#A31515; extendedProperty <span style="color:Red; xmlns:gd<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; http://schemas.google.com/g/2005<span style="color:Black; <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; OpenSocialUserId<span style="color:Black; <span style="color:Red; value<span style="color:Blue; =<span style="color:Black; <span style="color:Blue; 04276910534613129629<span style="color:Black; <span style="color:Blue; /><span style="color:Blue; </<span style="color:#A31515; author<span style="color:Blue; ><span style="color:Blue; <<span style="color:#A31515; thr<span style="color:Blue; :<span style="color:#A31515; total<span style="color:Blue; >0<span style="color:Blue; </<span style="color:#A31515; thr<span style="color:Blue; :<span style="color:#A31515; total<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; entry<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; feed<span style="color:Blue; >
[/code]

And this xslt file

<pre><?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions
<xsl:output method="html" />
<xsl:template match="feed
<xsl:for-each select="entry
<xsl:sort select="published" />
<div class="h2
<b>
<xsl:value-of select="title" />
</b>

<div class="date
<xsl:value-of select="fn:substring(updated,0,10)" />

<div clas="fontbreak
<p class="paragraph
<xsl:value-of select="content" />

<br />
<br />
<div class="line
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>[/code]

When i trannsform (either via javascript, c#, or the internet), i get this

<div style="color:Black;background-color:White; <pre>
"tag:blogger.com,1999:blog-89693483669939369142010-12-27T13:17:42.887-08:00Team #1334 RoboticsOTHS Roboticshttp://www.blogger.com/profile/12343885763233322609noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-8969348366993936914.post-2267189106252251312010-12-20T15:08:00.001-08:002010-12-20T17:29:32.595-08:00Test PostThis is just a test<span style="color:Red; &lt;br /<span style="color:Red; &gt;<span style="color:Red; &lt;br /<span style="color:Red; &gt;....<span style="color:Red; &lt;div class="blogger-post-footer"<span style="color:Red; &gt;<span style="color:Red; &lt;img width=1 height=1 src=https://blogger.googleusercontent.com/tracker/8969348366993936914-226718910625225131?l=othsrobotics.blogspot.com alt= /<span style="color:Red; &gt;<span style="color:Red; &lt;/div<span style="color:Red; &gt;OTHS Roboticshttp://www.blogger.com/profile/12343885763233322609noreply@blogger.com0"
[/code]
What am i doing wrong?


View the full article
 
Back
Top