Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » strange problem with error cvc-elt.1 and name space(moxy dosn't read and validation fails - in eclipse all is fine)
strange problem with error cvc-elt.1 and name space [message #1018847] Thu, 14 March 2013 15:07
moritz du is currently offline moritz duFriend
Messages: 98
Registered: February 2010
Member
I have a given xsd file and given examples for this file. the xsd is very similar to http://www.forum-datenaustausch.ch/hospitalinvoicerequest_400.xsd but with one additional element below the root.

The problem is if i validate the given xml against the schema (using moxy as JAXBCOntextFactory) i got this error:

    enterCaused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 221; cvc-elt.1: Cannot find the declaration of element 'invoice:request'.


invoice:request is the root element the xml begins:

    <invoice:request role="production" xmlns:invoice="http://www.medidata.ch/QO/XSD" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.medidata.ch/QO/XSD QO_MDInvoiceRequest_400.xsd">


xsd begins with:
<schema targetNamespace="http://www.medidata.ch/QO/XSD" xmlns:invoice="http://www.medidata.ch/QO/XSD" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">


If i validate the xml against the schema online or in eclipse (right click validate) all works fine. And if i change the name space from

xmlns:invoice="http://www.medidata.ch/QO/XSD"

to

xmlns:invoice="http://www.xmlData.ch/xmlInvoice/XSD"


the error disappears - but i get another one because of the additional element.
With this name space declaration i can't even read the contents without validation: the getter for root returns null. With the alternative declaration ("http://www.xmlData.ch/xmlInvoice/XSD") and without validation all works fine!

So whats wrong with the name space declaration?

[Updated on: Thu, 14 March 2013 15:14]

Report message to a moderator

Previous Topic:How to obtain the entity ID after persit from a trigger generated value
Next Topic:Is it possible to build EclipseLink 1.1.4 from source
Goto Forum:
  


Current Time: Sat Dec 20 06:49:07 GMT 2014

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

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