Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » key and keyref not validated via xsd?
key and keyref not validated via xsd? [message #99007] Wed, 04 May 2005 21:28 Go to next message
Eclipse UserFriend
Originally posted by: news.ronald.vankuijk.net

Hi,

I've taken an example xsd from the internet (http://www.xml.com/2002/09/04/examples/Workflow.xsd.txt) with a key and
keyref in it. It seems however that WTP1.0M4 (with eclipse 3.1m6 jdk1.4.2_05 on linux) does not validate against these
key/keyrefs. ID and IDREF do work.

If someone can confirm this I'll file a bug report.

Ronald
Re: key and keyref not validated via xsd? [message #99064 is a reply to message #99007] Thu, 05 May 2005 04:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: george.oxygenxml.com

Hi Ronald,

There is a known and already solved in CVS bug in Xerces 2.6.2, it does not
work correctly if the constraint contains multiple fields, see:
http://issues.apache.org/jira/browse/XERCESJ-1000

Best Regards,
George
------------------------------------------------------------ ---------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


"Ronald van Kuijk" <news@ronald.vankuijk.net> wrote in message
news:d5bt7e$q2u$1@news.eclipse.org...
> Hi,
>
> I've taken an example xsd from the internet
(http://www.xml.com/2002/09/04/examples/Workflow.xsd.txt) with a key and
> keyref in it. It seems however that WTP1.0M4 (with eclipse 3.1m6
jdk1.4.2_05 on linux) does not validate against these
> key/keyrefs. ID and IDREF do work.
>
> If someone can confirm this I'll file a bug report.
>
> Ronald
Re: key and keyref not validated via xsd? [message #99553 is a reply to message #99064] Thu, 05 May 2005 14:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: news.ronald.vankuijk.net

George,

Thanks for your response. The examples I've run do not contain multiple fields, but I tried other examples anyway (one
from http://www.oxygenxml.com/forum/ftopic679.html) That one works, so I focussed on using/adapting that one.

There is one major difference between the working example and the functionality that I want. It has to do with nesting
and so probably my xpath in either the selector or the field are wrong. I'll look further into that but post it here
anyway in case someone (you? ;-) ) see the mistake I make (the xpath should eventually contain an or since a transition
can go to any kinde of node including the one it is in)

xml document: ---------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<p:process-definition xmlns:p="http://www.example.org/process"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.example.org/process process.xsd ">
<p:state name="S1">
<p:transition to="S2" />
</p:state>
<p:state name="S2">
<p:transition to="D1" />
</p:state>
<p:decision name="D1">
<p:transition to="E1" />
</p:decision>
<p:end-state name="E1">
</p:end-state>

</p:process-definition>

xsd snippet (is on top-level element) -----------------------------------------------

<xsd:key name="nameKey">
<xsd:selector xpath="./state" />
<xsd:field xpath="@name" />
</xsd:key>
<xsd:keyref name="toRef" refer="nameKey">
<xsd:selector xpath="state/transition" />
<xsd:field xpath="@to" />
</xsd:keyref>


George Bina wrote:
> Hi Ronald,
>
> There is a known and already solved in CVS bug in Xerces 2.6.2, it does not
> work correctly if the constraint contains multiple fields, see:
> http://issues.apache.org/jira/browse/XERCESJ-1000
>
> Best Regards,
> George
> ------------------------------------------------------------ ---------
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
>
> "Ronald van Kuijk" <news@ronald.vankuijk.net> wrote in message
> news:d5bt7e$q2u$1@news.eclipse.org...
>
>>Hi,
>>
>>I've taken an example xsd from the internet
>
> (http://www.xml.com/2002/09/04/examples/Workflow.xsd.txt) with a key and
>
>>keyref in it. It seems however that WTP1.0M4 (with eclipse 3.1m6
>
> jdk1.4.2_05 on linux) does not validate against these
>
>>key/keyrefs. ID and IDREF do work.
>>
>>If someone can confirm this I'll file a bug report.
>>
>>Ronald
>
>
>
George
Re: key and keyref not validated via xsd? [message #100066 is a reply to message #99553] Fri, 06 May 2005 09:31 Go to previous message
Eclipse UserFriend
Originally posted by: george.oxygenxml.com

Hi Ronald,

At a first glance the problems seems to be that you are referring in the
identity constraints to elements from no namespace:
> <xsd:selector xpath="./state" />
> <xsd:selector xpath="state/transition" />
while in your document the state and transition elements are from
http://www.example.org/process namespace.
You should declare a proxy for http://www.example.org/process in your schema
(for instance xmlns:p="http://www.example.org/process") then use that to
prefix state and transition elements in the xs:selector/@xpath value, for
instance

<xsd:selector xpath="./p:state" />
<xsd:selector xpath="p:state/p:transition" />

The XPath expressions do not know the default namespace, elements without a
proxy are in no namespace.

Best Regards,
George
------------------------------------------------------------ ---------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


"Ronald van Kuijk" <news@ronald.vankuijk.net> wrote in message
news:427A621F.6090207@ronald.vankuijk.net...
> George,
>
> Thanks for your response. The examples I've run do not contain multiple
fields, but I tried other examples anyway (one
> from http://www.oxygenxml.com/forum/ftopic679.html) That one works, so I
focussed on using/adapting that one.
>
> There is one major difference between the working example and the
functionality that I want. It has to do with nesting
> and so probably my xpath in either the selector or the field are wrong.
I'll look further into that but post it here
> anyway in case someone (you? ;-) ) see the mistake I make (the xpath
should eventually contain an or since a transition
> can go to any kinde of node including the one it is in)
>
> xml document: ---------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <p:process-definition xmlns:p="http://www.example.org/process"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.example.org/process process.xsd ">
> <p:state name="S1">
> <p:transition to="S2" />
> </p:state>
> <p:state name="S2">
> <p:transition to="D1" />
> </p:state>
> <p:decision name="D1">
> <p:transition to="E1" />
> </p:decision>
> <p:end-state name="E1">
> </p:end-state>
>
> </p:process-definition>
>
> xsd snippet (is on top-level
element) -----------------------------------------------
>
> <xsd:key name="nameKey">
> <xsd:selector xpath="./state" />
> <xsd:field xpath="@name" />
> </xsd:key>
> <xsd:keyref name="toRef" refer="nameKey">
> <xsd:selector xpath="state/transition" />
> <xsd:field xpath="@to" />
> </xsd:keyref>
>
>
> George Bina wrote:
> > Hi Ronald,
> >
> > There is a known and already solved in CVS bug in Xerces 2.6.2, it does
not
> > work correctly if the constraint contains multiple fields, see:
> > http://issues.apache.org/jira/browse/XERCESJ-1000
> >
> > Best Regards,
> > George
> > ------------------------------------------------------------ ---------
> > George Cristian Bina
> > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> > http://www.oxygenxml.com
> >
> >
> > "Ronald van Kuijk" <news@ronald.vankuijk.net> wrote in message
> > news:d5bt7e$q2u$1@news.eclipse.org...
> >
> >>Hi,
> >>
> >>I've taken an example xsd from the internet
> >
> > (http://www.xml.com/2002/09/04/examples/Workflow.xsd.txt) with a key and
> >
> >>keyref in it. It seems however that WTP1.0M4 (with eclipse 3.1m6
> >
> > jdk1.4.2_05 on linux) does not validate against these
> >
> >>key/keyrefs. ID and IDREF do work.
> >>
> >>If someone can confirm this I'll file a bug report.
> >>
> >>Ronald
> >
> >
> >
> George
Previous Topic:java code completion
Next Topic:Change context root
Goto Forum:
  


Current Time: Fri Jul 18 20:52:55 EDT 2025

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

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

Back to the top