You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Bryan Wilcox <az...@yahoo.com> on 2006/03/24 22:57:54 UTC

xsd:key question

Hello All,
      I am trying to add a xsd:key constaint to an xml schema I am working on.  The constraint is written like this:
   
  <xsd:element name="TrainingCenterDatabase" type="TrainingCenterDatabase_t">
  <xsd:key name="GUIDKeyConstraint">
  <xsd:selector xpath=".//tc2:Workout | .//tc2:Course | .//tc2:Run"/>
  <xsd:field xpath="tc2:GUID"/>
  </xsd:key>
  </xsd:element>
   
  The GUID field can occur in a Workout, Course, and Run field at an arbitrary nested depth in any of the nodes below this Database && should be unique.  When I try and run a document through Xerces 2.5 that we have been using successfully for a number of years, I get the following error.
   
  "Error: File Path: String Stream, line: 8, char: 70 Message: '//' only allowed after '.' at the beginning of an xpath"
   
  This makes me think that Xerces 2.5 cannot correctly process .// Xpath statements that occur when combined by '|''s in the same line.  If I am doing something wrong, I would appreciate any feedback as I am still getting to know XSD schema.  However, XMLSpy seems to correctly handle this constraint, so it makes me think either I am missing something in Xerces or this is a bug in the program.
   
  Thanks,
Bryan
  

Axel Weiß <aw...@informatik.hu-berlin.de> wrote:
  Gareth Reakes wrote:
>  > Axel doesn't have the time to implement the
> DOMTypeInfo::isDerivedFrom > API).
>
> Axel, are we putting this off until next release? No problem if so,
> but if you need just a bot more time we can do release around that
> date.

Hi all,

I have been trying to take my time to work on this stuff, even have 
already started to dig. Unfortunately, I can't find the point to 
continue for months now, althought I'm seeking, but real life makes me 
too busy. This has to do with my change of employee, and I'm deeply 
stuck in projects.

Hopefully, the situation will relax soon. However, I don't like to 
promise anything that I eventually can't keep. So, you'd better not 
count on my participation for now.

Sorry for any inconveniences,
Axel

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org



		
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low rates.

Re: xsd:key question

Posted by Alberto Massari <am...@datadirect.com>.
Hi Brian,

At 01:57 PM 3/24/2006 -0800, Bryan Wilcox wrote:
>Hello All,
>     I am trying to add a xsd:key constaint to 
> an xml schema I am working on.  The constraint is written like this:
>
><xsd:element name="TrainingCenterDatabase" type="TrainingCenterDatabase_t">
><xsd:key name="GUIDKeyConstraint">
><xsd:selector xpath=".//tc2:Workout | .//tc2:Course | .//tc2:Run"/>
><xsd:field xpath="tc2:GUID"/>
></xsd:key>
></xsd:element>
>

It looks Xerces messes up your xpath expression 
if there is a space after a union operator; change it to be

<xsd:selector xpath=".//tc2:Workout |.//tc2:Course |.//tc2:Run"/>

Alberto

>The GUID field can occur in a Workout, Course, 
>and Run field at an arbitrary nested depth in 
>any of the nodes below this Database && should 
>be unique.  When I try and run a document 
>through Xerces 2.5 that we have been using 
>successfully for a number of years, I get the following error.
>
>"Error: File Path: String Stream, line: 8, char: 
>70 Message: '//' only allowed after '.' at the beginning of an xpath"
>
>This makes me think that Xerces 2.5 cannot 
>correctly process .// Xpath statements that 
>occur when combined by '|''s in the same 
>line.  If I am doing something wrong, I would 
>appreciate any feedback as I am still getting to 
>know XSD schema.  However, XMLSpy seems to 
>correctly handle this constraint, so it makes me 
>think either I am missing something in Xerces or this is a bug in the program.
>
>Thanks,
>Bryan
>
>
>Axel Weiß <aw...@informatik.hu-berlin.de> wrote:
>Gareth Reakes wrote:
> >  > Axel doesn't have the time to implement the
> > DOMTypeInfo::isDerivedFrom > API).
> >
> > Axel, are we putting this off until next release? No problem if so,
> > but if you need just a bot more time we can do release around that
> > date.
>
>Hi all,
>
>I have been trying to take my time to work on this stuff, even have
>already started to dig. Unfortunately, I can't find the point to
>continue for months now, al thought I'm seeking, but real life makes me
>too busy. This has to do with my change of employee, and I'm deeply
>stuck in projects.
>
>Hopefully, the situation will relax soon. However, I don't like to
>promise anything that I eventually can't keep. So, you'd better not
>count on my participation for now.
>
>Sorry for any inconveniences,
>Axel
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
>For additional commands, e-mail: c-dev-help@xerces.apache.org
>
>
>
>New 
><http://us.rd.yahoo.com/mail_us/taglines/postman4/*http://us.rd.yahoo.com/evt=39666/*http://beta.messenger.yahoo.com>Yahoo! 
>Messenger with Voice. Call regular phones from your PC for low, low rates.