472,353 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

System.Xml.XPath.XPathException

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
5 4038
* 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
Thanks very much. May be || for or worked in previous versions....

Nov 12 '05 #3
Thanks very much. May be || for or worked in previous versions....

Nov 12 '05 #4
Thanks very much. May be || for or worked in previous versions....

Nov 12 '05 #5
Thanks very much. May be || for or worked in previous versions....

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: mike p. | last post by:
I have a docbook xml file, and am using standard docbook 1.61.3 xsl stylesheets to do xhtml transform. Transform works fine when using MSXML. ...
1
by: alpha | last post by:
Hi Friends, When we need the xpath namespace as we can traverse the xml document using xmldocument object like using selectSingleNode or selectNodes...
4
by: David Thielen | last post by:
I have the following xml: <root> <name>abc "123" xyz</name> </root> When I get an XPathNavigator to root and then call...
3
by: Eugen Gulinsky | last post by:
Hello guys, I am having problems trying to migrate our MSXML4-compatible stylesheets containing large msxsl:script blocks to a formate...
0
by: nima | last post by:
Hi I have two tables in my database. PRODUCT and PRODUCT_GROUP. PRODUCT has a foreign key to PRODUCT_GROUP. I generated a typed dataset using...
4
by: Daniel | last post by:
Is it possible to use regular expressions inside of an xpath statement executed by System.Xml.XmlDocument.SelectSingleNode() ? string sdoc =...
2
by: dinhly | last post by:
I got the error message: System.Xml.XPath.XPathException, occurred in system.xml.dll, when I tried the code below: string lastName = "O'BRIEN";...
1
by: miamikk | last post by:
I have created XML files using BCP in SQL with FOR XML AUTO, ELEMENTS option. When I try to databind for XML file to a GridView in ASP.NET, I get...
2
by: arunairs | last post by:
Hi, Is there a way of validating and XPath? In this case , I am accepting an XPath from the user and I need to validate the XPath syntax. Is...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.