Click here to Skip to main content
15,886,872 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I have asp.net web application,

where i have to convert xml to html.

for that i was creating xslt file but unfortunately i'm getting one error while writing the xslt code.

i have some thing like this in xml file
<dc:rights>Copyright 2015</dc:rights>


when i'm writing xslt code for this line, i'm getting error prefix not defined!
<xsl:value-of select="dc:language"/> //error prefix 'dc' is not defined!



Full XML
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>demo</title>
    <link>http://www.abc.com/section.local.html</link>
    <description>demo</description>
    <dc:language>ar</dc:language>
    <image>
      <title>one</title>
      <url>http://www.abc.com/img/logo.gif</url>
      <link>http://www.abc.com/</link>
    </image>
    <dc:rights>Copyright 2015</dc:rights>
    <item>
      <title>test!</title>
      <link>http://www.abc.com/2015/03/22/article1032173.html</link>
      <guid>http://www.abc.com/2015/03/22/article1032173.html</guid>
      <description><![CDATA[

<img src="h250.jpg"  />
<br/>

abc...</description>
      <pubDate>Sun, 22 Mar 2015 00:00:00 +0300</pubDate>
    </item>
    <item>
      <title>testtitle>
      <link>http://www.ABC.com/2015/03/22/article1032109.html</link>
      <guid>http://www.ABC.com/2015/03/22/article1032109.html</guid>
      <description><![CDATA[

<img src="h250.jpg"  />
<br/>

abc</description>
      <pubDate>Sun, 22 Mar 2015 00:00:00 +0300</pubDate>
    </item>
    <item>
      <title>onetwo</title>
      <link>http://www.alriyadh.com/2015/03/22/article1032111.html</link>
      <guid>http://www.alriyadh.com/2015/03/22/article1032111.html</guid>
      <description><![CDATA[

<img src="h250.jpg"  />
<br/>

abc..</description>
      <pubDate>Sun, 22 Mar 2015 00:00:00 +0300</pubDate>
    </item>
</channel>
</rss>

Can any one plz help me, how to solve this.

Thanks
Posted
Updated 22-Mar-15 22:46pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900