OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Nasty XPath expressions

[ Lists Home | Date Index | Thread Index ]

I'm not sure how closely this mirrors the behavior of .valueOf, but I
often use:

node.SelectSingleNode(strXPath).InnerXml

This works with the native MSXML and managed .NET classes, and gives you
whatever the value of the selected element or attribute is.  You have to
cast it to the appropriate type if you want something other than a
string; you could probably get the type from the SOM if there is an XSD
associated, but I never bothered.

> -----Original Message-----
> From: Francis Norton [mailto:francis@redrice.com]
> Sent: Friday, December 14, 2001 10:13 AM
> To: Christian Nentwich
> Cc: xml-dev
> Subject: Re: [xml-dev] Nasty XPath expressions
> 
> 
> 
> Christian Nentwich wrote:
> 
> > On Fri, 2001-12-14 at 14:42, Steve Muench wrote:
> >
> >>Oracle's XML Parser also provides an XPath engine that's
> >>woven into our DOM implementation. Using it is as easy as:
> >>   yourNode.selectNodes("Your/Favorite[XPath=Here]");
> >>   yourNode.selectSingleNode("Your/Favorite[XPath=Here]");
> >>   yourNode.valueOf("Your/Favorite[XPath=Here]");
> >>
> >>
> >
> > You say your users haven't asked for more, but if I was to become
your
> > user, I would. .net offers these methods as well,
> 
> 
> How does .Net support .valueOf(<XPathExpression>)? I'm interested
> because the fact that MSXML 3 only supports XPath expressions that
> return node-lists is a bit of a frustration, and I couldn't find any
> improvement on this in .Net beta 2.
> 
> Francis.
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS