[
Lists Home |
Date Index |
Thread Index
]
SelectSingleNode and SelectSingleNodes threw a
Unhandled Exception: System.Xml.XPath.XPathException:
The expression passed to this method should result in a NodeSet.
everytime I tried to perform a query that didn't return a NodeSet. Thus I
don't think there's a .NET alternative to Oracle's node.valueOf(<Xpath
expression>);
Secondly, as at Beta 2 of .NET there is no way to attach a schema to a
document and access the PSVI via the SOM, so are you stating that this
functionality will exist when .NET finally ships?
--
THINGS TO DO IF I BECOME AN EVIL OVERLORD #159
If I burst into rebel headquarters and find it deserted except for an odd,
blinking device, I will not walk up and investigate; I'll run like hell.
----- Original Message -----
From: "Joshua Allen" <joshuaa@microsoft.com>
To: <francis@redrice.com>; "Christian Nentwich" <c.nentwich@cs.ucl.ac.uk>
Cc: "xml-dev" <xml-dev@lists.xml.org>
Sent: Friday, December 14, 2001 11:08 AM
Subject: RE: [xml-dev] Nasty XPath expressions
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>
-----------------------------------------------------------------
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>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|