On Mar 15, 9:30 pm, Bjoern Hoehrmann <bjo...@hoehrmann.de> wrote:
> * tschulken wrote in microsoft.public.dotnet.xml:
>
> >> ><S3Client>
> >> > <Buttons>
> >> > <Button>Activity
> >> > <RestrictedClientType>
> >> > <ClientType>02</ClientType>
> >> > </RestrictedClientType>
> >> > </Button>
> >> > ...
> >> > </Buttons>
> >> ></S3Client>
>
> Here the content of the <Button> element is this:
>
> 1. the word "Activity" followed by
> a line feed character followed by space characters
> 2. the RestrictedClientType element
> 3. a line feed character followed by space characters
>
> I do not know whether the code above has been pretty printed for
> readability, or whether it reflects what is actually in the tree
> in memory, but assuming this is how it is in memory your original
> ... Button=3D'Activity' ... would not work as that would match if
> the content was just 'Activity'.
>
> >That makes sense but it seems that I am having trouble getting it to
> >work. Since the <RestrictedClientType> was added as a child node of
> >Button, seems that the first part of my query doesn't work. I guess I
> >am used to parent nodes just having no values or maybe just attributes
> >but seems that since Button has a value of "Activity" and then the
> >child node, does querying for the Activity Text change? Here is an
> >example, before <RestrictedClientType> was added, this xpath query
> >would work fine:
> >_xmlDocument.SelectSingleNode( "/Security/S3Client/Buttons/
> >Button['Activity']" );
>
> I am not sure whether this is a typo, but this does not do what you
> want at all. The string literal 'Activity' is converted to a boolean
> (true) so this would select the first 'Button' element that has the
> ancestors Buttons, S3Client, Security, in that order. You could also
> write
>
> /Security/S3Client/Buttons/Button['HelloWorld']
>
> and the result would be the same.
>
> >Now that query does not work, any ideas?
>
> I do not see a reason why this would happen.
> --
> Bj=F6rn H=F6hrmann =B7 mailto:bjo...@hoehrmann.de =B7http://bjoern.hoehrm=
ann.de
> Weinh. Str. 22 =B7 Telefon: +49(0)621/4309674 =B7http://www.bjoernsworld.=
de
> 68309 Mannheim =B7 PGP Pub. KeyID: 0xA4357E78 =B7
http://www.websitedev.de/ Yes, what i had was a typo and I apologize. The xpath query should be
"/Security/S3Client/Buttons[Button=3D'Activity']". This used to work for
others since they don't have children). Is there a way for a single