all groups > dotnet xml > february 2004 >
You're in the

dotnet xml

group:

confused about NameSpace in xml files!



confused about NameSpace in xml files! C# newbie
2/25/2004 4:27:44 PM
dotnet xml:
Hi guys,

Something werid happening to me. When I run a query against every xml I
have, below query works fine and returns what it should be returned.

but there is another xml file as below, which doesnt' return what it should!

I run a query like: //*[contains(.,'the string I'm looking for within the
xml goes here')]

runs fine on this: //*[contains(.,'Dylan')]

xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>

</catalog>

***************************

runs wrong on:

when I run this //*[contains(.,'center')] it doesn't find center which is
between <Header> and </Header>

<Form FormName="test" FormID="124"
StyleUsage="URL" xmlns="http://www.testdomain.com"
SurveyProgrammer="newbie" DateTime="1/30/2004 6:57:28 PM">
<Params><BackgroundColor>#19384A</BackgroundColor><LinkColor>#ffffff</LinkCo
lor><VisitedLinkColor>#ffffff</VisitedLinkColor>
<TextColor>#ffffff</TextColor><Direction>ltr</Direction><BackgroundImage></B
ackgroundImage>
<Header>&lt;table width='600' cellspacing='0' callpadding='0' border='0'
align='center'&gt;
&lt;tr&gt;&lt;td&gt;&lt;img src='images/ifilmtest.gif' alt='test'
width='175'
height='62'&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;br&gt;
</Header>
....
....
....
</Form>


Is the problem with NameSpace thing within the xml?




any idea?

Thanks in advance
c# newbie

Re: confused about NameSpace in xml files! Dare Obasanjo [MSFT]
2/25/2004 8:54:22 PM
The query works fine on my machine. It returns the 3 nodes I expect it to
<Form>, <Params> and <Header>. There is no problem here nor anything related
to namespaces I can tell.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

Re: confused about NameSpace in xml files! C# newbie
2/27/2004 6:36:12 PM
Thanks a lot.

[quoted text, click to view]

AddThis Social Bookmark Button