Click to See Complete Forum and Search --> : hide display


ennidhi
06-01-2007, 01:42 AM
i want to hide this <title>CCH Wall Street</title>
<link>http://cp.llesiant.com/Delivery/RSSContentSet.asp?id=89C66C75-6E53-4F84-B778-CC7F5157D57F&n=3&days=7</link>
<description>There are 139 items available.</description>
<language>en-us</language>
<cf:treatAs xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005">list</cf:treatAs>part of XML from the display using xslt. please suggest me here.


<rss version="2.0">

<channel>
<title>CCH Wall Street</title>
<link>http://cp.llesiant.com/Delivery/RSSContentSet.asp?id=89C66C75-6E53-4F84-B778-CC7F5157D57F&n=3&days=7</link>
<description>There are 139 items available.</description>
<language>en-us</language>
<cf:treatAs xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005">list</cf:treatAs>

<item>
<title>Barclays, former trader settle SEC charges in NYC for over $10.9M</title>
<link>http://cp.llesiant.com/Delivery/ExternalContent.asp?contentId=225969440000000187</link>
<description>NEW YORK (AP) -- Barclays Bank PLC has agreed to pay $10.9 million and a former trader for the bank agreed to pay $750,000 to settle charges that they engaged in securities fraud through a pattern...</description>
<source url="/Delivery/ExternalContent.asp?contentId=225969440000000187">NY Metro</source>
<pubDate>30 May 2007 19:19:00 UT</pubDate>
<guid isPermaLink="false">225969440000000187</guid>
</item>

<item>
<title>New CCH White Paper Covers SEC, PCAOB Internal Controls Guidance</title>
<link>http://cp.llesiant.com/Delivery/ExternalContent.asp?contentId=225969400000000111</link>
<description>CCH Securities Law Analyst and Author Available for Comment RIVERWOODS, Ill., May 30 /PRNewswire/ -- CCH principal analyst and leading author on securities law, Jim Hamilton, JD, LLM, has released...</description>
<source url="/Delivery/ExternalContent.asp?contentId=225969400000000111">KCAU-TV</source>
<pubDate>30 May 2007 19:09:00 UT</pubDate>
<guid isPermaLink="false">225969400000000111</guid>
</item>

<item>
<title>Investor Alert From Cauley Bowman Carney & Williams, PLLC: Update on Proposed Acquisition of Bradley Pharmaceu</title>
<link>http://cp.llesiant.com/Delivery/ExternalContent.asp?contentId=225969176000000147</link>
<description>/PRNewswire/ -- Cauley Bowman Carney &amp; Williams, PLLC announces an investigation into the proposed acquisition of Bradley Pharmaceuticals, Inc. ('Bradley'). On May 29, 2007, Bradley announced...</description>
<source url="/Delivery/ExternalContent.asp?contentId=225969176000000147">Pharma Live</source>
<pubDate>30 May 2007 18:14:00 UT</pubDate>
<guid isPermaLink="false">225969176000000147</guid>
</item>

</channel>

</rss>

Charles
06-01-2007, 05:24 AM
<xsl:template match="channel/*"/>

ennidhi
06-01-2007, 05:27 AM
does it solve the purpose? i did not understand the logic here. please update me

ennidhi
06-01-2007, 05:32 AM
still i have the problem

ennidhi
06-01-2007, 05:36 AM
please help me here. i could not able find out the solution

Charles
06-01-2007, 06:20 AM
You create a template that matches what you want to hide and just have the template do nothing.

In this case I create a template that matches all of the children of the channel element. I expect that you have another template that matches the item elements. That template will be more specific and override the other and so the item elements will be shown and everything else hidden.

ennidhi
06-01-2007, 06:41 AM
i have done this(template to hide the portaion of the xml). but the blank space is appearing on the display.

ennidhi
06-01-2007, 06:47 AM
<?xml version="1.0" encoding="ISO-8859-1"?>


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="ISO-8859-1"/>

<xsl:template match="/">
<link rel="stylesheet" href="/ws-portal/css/newsfeed.css" type="text/css" />
<script language="javascript" src="/ws-portal/jscript/newsfeed.js"></script>
<xsl:element name="newsfeed_container">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>

<xsl:template match="channel/*" >

<xsl:template match="item">

<!-- create link for newsfeed -->
<xsl:element name="div">
<xsl:attribute name="id">newsfeed_link</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="class">newsfeedlink</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>javascript:openNewsfeedLink('</xsl:text>
<xsl:value-of select="link"/>
<xsl:text>')</xsl:text>
</xsl:attribute>
<!-- show newsfeed title-->
<xsl:value-of select="title"/>
</xsl:element>
</xsl:element>

<!-- show the description of newsfeed -->
<xsl:element name="div">
<xsl:attribute name="id">newsfeed_description</xsl:attribute>
<xsl:value-of select="description"/>
</xsl:element>
<!-- show the publication date of newsfeed -->
<xsl:element name="div">
<xsl:attribute name="id">newsfeed_published_date</xsl:attribute>
<xsl:value-of select="datePublished"/>
</xsl:element>

</xsl:template>
</xsl:template>
<xsl:template match="docHits">
<!-- nop -->
</xsl:template>

</xsl:stylesheet>
<!--

-->

Charles
06-01-2007, 07:42 AM
What you have there does not match my example.

ennidhi
06-01-2007, 07:59 AM
<?xml version="1.0" encoding="ISO-8859-1"?>



<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="ISO-8859-1"/>

<xsl:template match="/">
<link rel="stylesheet" href="/ws-portal/css/newsfeed.css" type="text/css" />
<script language="javascript" src="/ws-portal/jscript/newsfeed.js"></script>
<xsl:element name="newsfeed_container">
<xsl:apply-templates select="//item"/>
</xsl:element>
</xsl:template>



<xsl:template match="item">

<!-- create link for newsfeed -->
<xsl:element name="div">
<xsl:attribute name="id">newsfeed_link</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="class">newsfeedlink</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>javascript:openNewsfeedLink('</xsl:text>
<xsl:value-of select="link"/>
<xsl:text>')</xsl:text>
</xsl:attribute>
<!-- show newsfeed title-->
<xsl:value-of select="title"/>
</xsl:element>
</xsl:element>

<!-- show the description of newsfeed -->
<xsl:element name="div">
<xsl:attribute name="id">newsfeed_description</xsl:attribute>
<xsl:value-of select="description"/>
</xsl:element>
<!-- show the publication date of newsfeed -->
<xsl:element name="div">
<xsl:attribute name="id">newsfeed_published_date</xsl:attribute>
<xsl:value-of select="pubDate"/>
</xsl:element>

</xsl:template>

<xsl:template match="docHits">
<!-- nop -->
</xsl:template>

</xsl:stylesheet>

Charles
06-01-2007, 08:02 AM
That'll work also.