By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,217 Members | 1,446 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,217 IT Pros & Developers. It's quick & easy.

System.Xml.XPath.XPathException

P: n/a
Hi

I have the following xsl stmt.
<xsl:for-each select="JOB_POSTINGS/JOB_POSTING
[(
(CITY='Atlanta' and STATE='GA')
)]\">
<xsl:sort select="JOB_TITLE" order="ascending"/>

This works fine when I use it.
But when using multiple values in the where clause as below

<xsl:for-each select="JOB_POSTINGS/JOB_POSTING
[(
(CITY='Arlington' and STATE='VA') ||
(CITY='Atlanta' and STATE='GA')
)]\">
<xsl:sort select="JOB_TITLE" order="ascending"/>

I get an error message. Anyone pl. tell how i need to do this, if I am
doing something completely wrong?

Thanks very much..
-laks..

[XPathException: The expression passed to this method should result in
a NodeSet.]
System.Xml.XPath.XPathParser.ParseNodeTest(AstNode qyInput, AxisType
axisType, XPathNodeType nodeType) +834
System.Xml.XPath.XPathParser.ParseStep(AstNode qyInput) +207
System.Xml.XPath.XPathParser.ParseRelativeLocation Path(AstNode
qyInput) +12
System.Xml.XPath.XPathParser.ParseLocationPath(Ast Node qyInput) +157
System.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput) +140
System.Xml.XPath.XPathParser.ParseUnionExpr(AstNod e qyInput) +65
System.Xml.XPath.XPathParser.ParseUnaryExpr(AstNod e qyInput) +81
System.Xml.XPath.XPathParser.ParseMultiplicativeEx pr(AstNode
qyInput) +22
System.Xml.XPath.XPathParser.ParseAdditiveExpr(Ast Node qyInput) +22
System.Xml.XPath.XPathParser.ParseRelationalExpr(A stNode qyInput)
+22
System.Xml.XPath.XPathParser.ParseEqualityExpr(Ast Node qyInput) +22
System.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput) +17
System.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput) +17
System.Xml.XPath.XPathParser.ParsePrimaryExpr(AstN ode qyInput) +415
System.Xml.XPath.XPathParser.ParseFilterExpr(AstNo de qyInput) +16
System.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput) +32
System.Xml.XPath.XPathParser.ParseUnionExpr(AstNod e qyInput) +22
System.Xml.XPath.XPathParser.ParseUnaryExpr(AstNod e qyInput) +81
System.Xml.XPath.XPathParser.ParseMultiplicativeEx pr(AstNode
qyInput) +22
System.Xml.XPath.XPathParser.ParseAdditiveExpr(Ast Node qyInput) +22
System.Xml.XPath.XPathParser.ParseRelationalExpr(A stNode qyInput)
+22
System.Xml.XPath.XPathParser.ParseEqualityExpr(Ast Node qyInput) +22
System.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput) +17
System.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput) +17
System.Xml.XPath.XPathParser.ParseStep(AstNode qyInput) +404
System.Xml.XPath.XPathParser.ParseRelativeLocation Path(AstNode
qyInput) +12
System.Xml.XPath.XPathParser.ParseRelativeLocation Path(AstNode
qyInput) +106
System.Xml.XPath.XPathParser.ParseLocationPath(Ast Node qyInput) +157
System.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput) +140
System.Xml.XPath.XPathParser.ParseUnionExpr(AstNod e qyInput) +22
System.Xml.XPath.XPathParser.ParseUnaryExpr(AstNod e qyInput) +81
System.Xml.XPath.XPathParser.ParseMultiplicativeEx pr(AstNode
qyInput) +22
System.Xml.XPath.XPathParser.ParseAdditiveExpr(Ast Node qyInput) +22
System.Xml.XPath.XPathParser.ParseRelationalExpr(A stNode qyInput)
+22
System.Xml.XPath.XPathParser.ParseEqualityExpr(Ast Node qyInput) +22
System.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput) +17
System.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput) +17
System.Xml.XPath.XPathParser.ParseXPathExpresion(S tring
xpathExpresion) +55
System.Xml.Xsl.Compiler.AddQuery(String xpathQuery, Boolean
allowVar, Boolean allowKey) +64

[XsltException: 'JOB_POSTINGS/JOB_POSTING[((CITY='Arlington' and
STATE='VA') ||(CITY='Atlanta' and STATE='GA') ) ]' is an invalid XPath
expression.]
System.Xml.Xsl.Compiler.AddQuery(String xpathQuery, Boolean
allowVar, Boolean allowKey) +296
System.Xml.Xsl.ForEachAction.CompileAttribute(Comp iler compiler) +77
System.Xml.Xsl.CompiledAction.CompileAttributes(Co mpiler compiler)
+193
System.Xml.Xsl.ForEachAction.Compile(Compiler compiler) +16
System.Xml.Xsl.Compiler.CreateForEachAction() +38
System.Xml.Xsl.ContainerAction.CompileInstruction( Compiler compiler)
+378
System.Xml.Xsl.ContainerAction.CompileOnceTemplate (Compiler
compiler) +78
System.Xml.Xsl.ContainerAction.CompileTemplate(Com piler compiler)
+15
System.Xml.Xsl.TemplateAction.Compile(Compiler compiler) +155
System.Xml.Xsl.Compiler.CreateTemplateAction() +52
System.Xml.Xsl.ContainerAction.CompileTopLevelElem ents(Compiler
compiler) +758
System.Xml.Xsl.ContainerAction.CompileDocument(Com piler compiler,
Boolean inInclude) +175
System.Xml.Xsl.RootAction.Compile(Compiler compiler) +7
System.Xml.Xsl.Compiler.CreateRootAction() +128
System.Xml.Xsl.Compiler.Compile(NavigatorInput input, XmlResolver
xmlResolver, Evidence evidence) +204

[XsltCompileException: (1,132) :
]
System.Xml.Xsl.Compiler.Compile(NavigatorInput input, XmlResolver
xmlResolver, Evidence evidence) +296
System.Xml.Xsl.XslTransform.Compile(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence) +215
System.Xml.Xsl.XslTransform.Load(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence) +123
System.Xml.Xsl.XslTransform.Load(XmlReader stylesheet, XmlResolver
resolver, Evidence evidence) +74
cbre.Templates.Corporate.General.JobSearch.btnSubm it(Object sender,
ImageClickEventArgs e) in
c:\websites\cbrecms\cbrecom\cbre\templates\corpora te\general\jobsearch.aspx.cs:428
System.Web.UI.WebControls.ImageButton.OnClick(Imag eClickEventArgs e)
+109

System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +69
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1292

Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
* laks wrote in microsoft.public.dotnet.xml:
But when using multiple values in the where clause as below

<xsl:for-each select="JOB_POSTINGS/JOB_POSTING
[(
(CITY='Arlington' and STATE='VA') ||
(CITY='Atlanta' and STATE='GA')
)]\">


The operator is "or" not "||".
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Nov 12 '05 #2

P: n/a
Thanks very much. May be || for or worked in previous versions....

Nov 12 '05 #3

P: n/a
Thanks very much. May be || for or worked in previous versions....

Nov 12 '05 #4

P: n/a
Thanks very much. May be || for or worked in previous versions....

Nov 12 '05 #5

P: n/a
Thanks very much. May be || for or worked in previous versions....

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.