Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » xpath error
xpath error [message #775469] Fri, 06 January 2012 03:31 Go to next message
albert g is currently offline albert gFriend
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 06:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: xpath error [message #775661 is a reply to message #775516] Fri, 06 January 2012 13:32 Go to previous messageGo to next message
albert g is currently offline albert gFriend
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 14:15 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
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>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Being introduced to XSDs
Next Topic:Problem with xsd and xml validation using JAXB
Goto Forum:
  


Current Time: Thu Apr 18 23:32:24 GMT 2024

Powered by FUDForum. Page generated in 0.02592 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top