Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » xpath error
xpath error [message #775469] Thu, 05 January 2012 22:31 Go to next message
albert g is currently offline albert g
Messages: 2
Registered: January 2012
Junior Member
Hi guys,

<xsd:keyref name="Ref1" refer="referA">
<xsd:selector xpath=".//AAAA[@name=&quot;myval&quot;]" />
<xsd:field xpath="@attribute1" />
</xsd:keyref>

I want to select all AAAA nodes with name attribute value of "myval" but I'm getting syntax error. Can you please help me on this?

Thanks.
Re: xpath error [message #775516 is a reply to message #775469] Fri, 06 January 2012 01:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Comments below.

On 06/01/2012 4:31 AM, albert g wrote:
> Hi guys,
>
> <xsd:keyref name="Ref1" refer="referA">
> <xsd:selector xpath=".//AAAA[@name="myval"]" />
Wouldn't you expect the second " after the first " to end the string
literal? XML allows either a ' or a " to be used, and depending on which
you use for the string as a whole, you should use the other inside the
string.
> <xsd:field xpath="@attribute1" />
> </xsd:keyref>
>
> I want to select all AAAA nodes with name attribute value of "myval"
> but I'm getting syntax error. Can you please help me on this?
>
> Thanks.
Re: xpath error [message #775661 is a reply to message #775516] Fri, 06 January 2012 08:32 Go to previous messageGo to next message
albert g is currently offline albert g
Messages: 2
Registered: January 2012
Junior Member

Hi Ed,

I replaced the quotes with &quot; but still not working.
<xsd:selector xpath=".//AAAA[@name=&quot;myval&quot;]" />
Re: xpath error [message #775688 is a reply to message #775661] Fri, 06 January 2012 09:15 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
It still looks like you have four double quotes...<br>
<br>
Also, it doesn't like like you're conforming to the restricted
subset of XPath that's permitted by the specification:<br>
<blockquote><a
href="http://www.w3.org/TR/xmlschema-1/#coss-identity-constraint">http://www.w3.org/TR/xmlschema-1/#coss-identity-constraint</a><br>
</blockquote>
<br>
On 06/01/2012 2:32 PM, albert g wrote:
<blockquote cite="mid:je6t5e$ir5$1@news.eclipse.org" type="cite">
<br>
Hi Ed,
<br>
<br>
I replaced the quotes with " but still not working.
<br>
&lt;xsd:selector xpath=".//AAAA[@name="myval"]" /&gt;
<br>
<br>
</blockquote>
</body>
</html>
Previous Topic:Being introduced to XSDs
Next Topic:Problem with xsd and xml validation using JAXB
Goto Forum:
  


Current Time: Tue Sep 02 07:43:16 EDT 2014

Powered by FUDForum. Page generated in 0.14809 seconds