Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Sat, 9 Aug 2008 11:35:49 +0800,    group: microsoft.public.xml        back       


Strange! about getElementsByTagName   
a xml file.
the doc has a node <content src='...'/>,
all node can be get by using  getElementsByTagName(L"*",...),
but i cannot get the <content> element by using this:
 getElementsByTagName(L"content",...)
even:
 getElementsByTagName(CComBSTR(L"content"),...)

why?

link to the file:
http://alovespring.googlecode.com/files/test.xml
date: Sat, 9 Aug 2008 11:35:49 +0800   author:   susan

Re: Strange! about getElementsByTagName   
susan wrote:
> a xml file.
> the doc has a node <content src='...'/>,
> all node can be get by using  getElementsByTagName(L"*",...),
> but i cannot get the <content> element by using this:
> getElementsByTagName(L"content",...)
> even:
> getElementsByTagName(CComBSTR(L"content"),...)
> 
> why?
> 
> link to the file:
> http://alovespring.googlecode.com/files/test.xml

You might need XPath and selectSingleNode or selectNodes together with
namespaces e.g. (JScript syntax)
  xmlDoc.setProperty("SelectionLanguage", "XPath")
  xmlDoc.setProperty("SelectionNamespaces",
"xmlns:atom='http://www.w3.org/2005/Atom'")
  var nodeList = xmlDoc.selectNodes("//atom:content")
as those elements are in the Atom namespace.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Sat, 09 Aug 2008 13:30:12 +0200   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us