Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using removechild

Status
Not open for further replies.

dranium

Technical User
Mar 9, 2009
15
CA
Is it possible to remove everything that is inside my <item> node? I am using ASP.

xmlDoc=loadXMLDoc("sports.xml")

set y= xmlDoc.getElementsByTagName("channel/item")(0)
xmlDoc.documentElement.removeChild(y)

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="/css/rss_itemcontent.css" type="text/css" media="screen"?>
<rss xmlns:content="[URL unfurl="true"]http://purl.org/rss/1.0/modules/content/"[/URL] version="2.0">
	<channel>
		<title>My title</title>
		<link>[URL unfurl="true"]http://www.example.com</link>[/URL]
		<description>Decription</description>
	
		<item>
			<title>Title 1</title> 
			<pubDate>Wed, 9 Apr 2009 11:58:56 GMT</pubDate>
			<link>[URL unfurl="true"]http://www.example.com/link1.html</link>[/URL] 
			<description>Description 1</description> 
			<author>Author 1</author>
			<category>Baseball</category>
		</item>
		
		<item>
			<title>Title 2</title> 
			<pubDate>Wed, 11 Apr 2009 11:58:56 GMT</pubDate>
			<link>[URL unfurl="true"]http://www.example.com/link2.html</link>[/URL] 
			<description>Description 2</description> 
			<author>Author 2</author>
			<category>Baseball</category>
		</item>
		
		<item>
			<title>Title 3</title> 
			<pubDate>Wed, 13 Apr 2009 11:58:56 GMT</pubDate>
			<link>[URL unfurl="true"]http://www.example.com/link3.html</link>[/URL] 
			<description>Description 3</description> 
			<author>Author 3</author>
			<category>Hockey</category>
		</item>
	</channel>
</rss>
 
This message can be ignored. I figured out how to do this using parentNode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top