[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Nasty XPath expressions

  • To: <francis@r...>,"Christian Nentwich" <c.nentwich@c...>
  • Subject: RE: Nasty XPath expressions
  • From: "Joshua Allen" <joshuaa@m...>
  • Date: Fri, 14 Dec 2001 11:08:15 -0800
  • Cc: "xml-dev" <xml-dev@l...>
  • Thread-index: AcGEy4IdCu+ZWirMTZWJx6ML1wnuUgABoP+g
  • Thread-topic: Nasty XPath expressions

.net selectsinglenode
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@r...]
> Sent: Friday, December 14, 2001 10:13 AM
> To: Christian Nentwich
> Cc: xml-dev
> Subject: Re:  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>


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.