Return-Path: X-Original-To: apmail-xerces-j-dev-archive@www.apache.org Delivered-To: apmail-xerces-j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 51DD66940 for ; Tue, 24 May 2011 15:39:30 +0000 (UTC) Received: (qmail 41076 invoked by uid 500); 24 May 2011 15:39:30 -0000 Delivered-To: apmail-xerces-j-dev-archive@xerces.apache.org Received: (qmail 41029 invoked by uid 500); 24 May 2011 15:39:29 -0000 Mailing-List: contact j-dev-help@xerces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: j-dev@xerces.apache.org Delivered-To: mailing list j-dev@xerces.apache.org Received: (qmail 41022 invoked by uid 99); 24 May 2011 15:39:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 15:39:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 15:39:28 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 86409DC9B2 for ; Tue, 24 May 2011 15:38:47 +0000 (UTC) Date: Tue, 24 May 2011 15:38:47 +0000 (UTC) From: "Aaron Anderson (JIRA)" To: j-dev@xerces.apache.org Message-ID: <1342099959.39504.1306251527546.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (XERCESJ-1510) XML Schema Validation ignores parent any declaration MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 XML Schema Validation ignores parent any declaration ---------------------------------------------------- Key: XERCESJ-1510 URL: https://issues.apache.org/jira/browse/XERCESJ-1510 Project: Xerces2-J Issue Type: Bug Components: JAXP (javax.xml.validation) Affects Versions: 2.11.0 Reporter: Aaron Anderson I am attempting to validate a WSDL document that contains an extension. According to the WSDL schema the definitions type parent allows the any wildcard definition. However, during validation, the extention element is reported as being invalid. I enabled debugging on the org.apache.xerces.impl.xs.models.XSDFACM class to try to troubleshoot the problem. package xercestest; import java.net.URL; import javax.xml.XMLConstants; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; public class XercesTest { public static void main(String[] args) { try { SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); StreamSource src = new StreamSource(new URL("http://schemas.xmlsoap.org/wsdl/").openStream()); Schema schema = sf.newSchema(src); Validator validator = schema.newValidator(); src = new StreamSource(new URL("http://svn.apache.org/repos/asf/ode/trunk/bpel-test/src/test/resources/bpel/2.0/HelloWorld2//HelloWorld2.wsdl").openStream()); validator.validate(src); } catch (Exception e) { e.printStackTrace(); } } } run: Seq Node firstPos={ 0 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Any Node: firstPos={ 0 } lastPos={ 0 } Leaf: (pos=1), (elemIndex=null) firstPos={ 1 } lastPos={ 1 } DFA build: 0ms Seq Node firstPos={ 0 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Leaf: (pos=1), (elemIndex=null) firstPos={ 1 } lastPos={ 1 } DFA build: 0ms Seq Node firstPos={ 0 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Leaf: (pos=1), (elemIndex=null) firstPos={ 1 } lastPos={ 1 } DFA build: 0ms Seq Node firstPos={ 0 1 2 } lastPos={ 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Leaf: (pos=2), (elemIndex=null) firstPos={ 2 } lastPos={ 2 } DFA build: 0ms Seq Node firstPos={ 0 1 2 3 4 5 6 7 8 } lastPos={ 8 } Seq Node Nullable firstPos={ 0 1 2 3 4 5 6 7 } lastPos={ 0 1 2 3 4 5 6 7 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 2 3 4 5 6 7 } lastPos={ 2 3 4 5 6 7 } Choice Node firstPos={ 2 3 4 5 6 7 } lastPos={ 2 3 4 5 6 7 } Choice Node firstPos={ 2 3 4 5 6 } lastPos={ 2 3 4 5 6 } Choice Node firstPos={ 2 3 4 5 } lastPos={ 2 3 4 5 } Choice Node firstPos={ 2 3 4 } lastPos={ 2 3 4 } Choice Node firstPos={ 2 3 } lastPos={ 2 3 } Leaf: (pos=2), (elemIndex="http://schemas.xmlsoap.org/wsdl/":import) firstPos={ 2 } lastPos={ 2 } Leaf: (pos=3), (elemIndex="http://schemas.xmlsoap.org/wsdl/":types) firstPos={ 3 } lastPos={ 3 } Leaf: (pos=4), (elemIndex="http://schemas.xmlsoap.org/wsdl/":message) firstPos={ 4 } lastPos={ 4 } Leaf: (pos=5), (elemIndex="http://schemas.xmlsoap.org/wsdl/":portType) firstPos={ 5 } lastPos={ 5 } Leaf: (pos=6), (elemIndex="http://schemas.xmlsoap.org/wsdl/":binding) firstPos={ 6 } lastPos={ 6 } Leaf: (pos=7), (elemIndex="http://schemas.xmlsoap.org/wsdl/":service) firstPos={ 7 } lastPos={ 7 } Leaf: (pos=8), (elemIndex=null) firstPos={ 8 } lastPos={ 8 } DFA build: 16ms Seq Node firstPos={ 0 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Leaf: (pos=1), (elemIndex=null) firstPos={ 1 } lastPos={ 1 } DFA build: 16ms Seq Node firstPos={ 0 1 2 } lastPos={ 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Leaf: (pos=2), (elemIndex=null) firstPos={ 2 } lastPos={ 2 } DFA build: 16ms Seq Node firstPos={ 0 1 2 3 } lastPos={ 3 } Seq Node Nullable firstPos={ 0 1 2 } lastPos={ 0 1 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 2 } lastPos={ 2 } Leaf: (pos=2), (elemIndex="http://schemas.xmlsoap.org/wsdl/":part) firstPos={ 2 } lastPos={ 2 } Leaf: (pos=3), (elemIndex=null) firstPos={ 3 } lastPos={ 3 } DFA build: 16ms Seq Node firstPos={ 0 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Leaf: (pos=1), (elemIndex=null) firstPos={ 1 } lastPos={ 1 } DFA build: 16ms Seq Node firstPos={ 0 1 2 } lastPos={ 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Leaf: (pos=1), (elemIndex="http://schemas.xmlsoap.org/wsdl/":operation) firstPos={ 1 } lastPos={ 1 } Leaf: (pos=2), (elemIndex=null) firstPos={ 2 } lastPos={ 2 } DFA build: 16ms Seq Node firstPos={ 0 1 2 5 } lastPos={ 8 } Seq Node firstPos={ 0 1 2 5 } lastPos={ 2 3 4 5 6 7 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Choice Node firstPos={ 2 5 } lastPos={ 2 3 4 5 6 7 } Seq Node firstPos={ 2 } lastPos={ 2 3 4 } Leaf: (pos=2), (elemIndex="http://schemas.xmlsoap.org/wsdl/":input) firstPos={ 2 } lastPos={ 2 } Rep Node Nullable firstPos={ 3 } lastPos={ 3 4 } Seq Node firstPos={ 3 } lastPos={ 3 4 } Leaf: (pos=3), (elemIndex="http://schemas.xmlsoap.org/wsdl/":output) firstPos={ 3 } lastPos={ 3 } Rep Node Nullable firstPos={ 4 } lastPos={ 4 } Leaf: (pos=4), (elemIndex="http://schemas.xmlsoap.org/wsdl/":fault) firstPos={ 4 } lastPos={ 4 } Seq Node firstPos={ 5 } lastPos={ 5 6 7 } Leaf: (pos=5), (elemIndex="http://schemas.xmlsoap.org/wsdl/":output) firstPos={ 5 } lastPos={ 5 } Rep Node Nullable firstPos={ 6 } lastPos={ 6 7 } Seq Node firstPos={ 6 } lastPos={ 6 7 } Leaf: (pos=6), (elemIndex="http://schemas.xmlsoap.org/wsdl/":input) firstPos={ 6 } lastPos={ 6 } Rep Node Nullable firstPos={ 7 } lastPos={ 7 } Leaf: (pos=7), (elemIndex="http://schemas.xmlsoap.org/wsdl/":fault) firstPos={ 7 } lastPos={ 7 } Leaf: (pos=8), (elemIndex=null) firstPos={ 8 } lastPos={ 8 } DFA build: 31ms Seq Node firstPos={ 0 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Leaf: (pos=1), (elemIndex=null) firstPos={ 1 } lastPos={ 1 } DFA build: 31ms Seq Node firstPos={ 0 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Leaf: (pos=1), (elemIndex=null) firstPos={ 1 } lastPos={ 1 } DFA build: 31ms Seq Node firstPos={ 0 1 2 3 } lastPos={ 3 } Seq Node Nullable firstPos={ 0 1 2 } lastPos={ 0 1 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 2 } lastPos={ 2 } Leaf: (pos=2), (elemIndex="http://schemas.xmlsoap.org/wsdl/":operation) firstPos={ 2 } lastPos={ 2 } Leaf: (pos=3), (elemIndex=null) firstPos={ 3 } lastPos={ 3 } DFA build: 31ms Seq Node firstPos={ 0 1 2 } lastPos={ 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Leaf: (pos=2), (elemIndex=null) firstPos={ 2 } lastPos={ 2 } DFA build: 31ms Seq Node firstPos={ 0 1 2 } lastPos={ 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Leaf: (pos=2), (elemIndex=null) firstPos={ 2 } lastPos={ 2 } DFA build: 31ms Seq Node firstPos={ 0 1 2 3 4 5 } lastPos={ 5 } Seq Node Nullable firstPos={ 0 1 2 3 4 } lastPos={ 0 1 2 3 4 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Seq Node Nullable firstPos={ 2 3 4 } lastPos={ 2 3 4 } Seq Node Nullable firstPos={ 2 3 } lastPos={ 2 3 } Rep Node Nullable firstPos={ 2 } lastPos={ 2 } Leaf: (pos=2), (elemIndex="http://schemas.xmlsoap.org/wsdl/":input) firstPos={ 2 } lastPos={ 2 } Rep Node Nullable firstPos={ 3 } lastPos={ 3 } Leaf: (pos=3), (elemIndex="http://schemas.xmlsoap.org/wsdl/":output) firstPos={ 3 } lastPos={ 3 } Rep Node Nullable firstPos={ 4 } lastPos={ 4 } Leaf: (pos=4), (elemIndex="http://schemas.xmlsoap.org/wsdl/":fault) firstPos={ 4 } lastPos={ 4 } Leaf: (pos=5), (elemIndex=null) firstPos={ 5 } lastPos={ 5 } DFA build: 47ms Seq Node firstPos={ 0 1 2 3 } lastPos={ 3 } Seq Node Nullable firstPos={ 0 1 2 } lastPos={ 0 1 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 2 } lastPos={ 2 } Leaf: (pos=2), (elemIndex="http://schemas.xmlsoap.org/wsdl/":port) firstPos={ 2 } lastPos={ 2 } Leaf: (pos=3), (elemIndex=null) firstPos={ 3 } lastPos={ 3 } DFA build: 47ms Seq Node firstPos={ 0 1 2 } lastPos={ 2 } Seq Node Nullable firstPos={ 0 1 } lastPos={ 0 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Leaf: (pos=0), (elemIndex="http://schemas.xmlsoap.org/wsdl/":documentation) firstPos={ 0 } lastPos={ 0 } Rep Node Nullable firstPos={ 1 } lastPos={ 1 } Any Node: firstPos={ 1 } lastPos={ 1 } Leaf: (pos=2), (elemIndex=null) firstPos={ 2 } lastPos={ 2 } DFA build: 47ms Seq Node firstPos={ 0 1 } lastPos={ 1 } Rep Node Nullable firstPos={ 0 } lastPos={ 0 } Any Node: firstPos={ 0 } lastPos={ 0 } Leaf: (pos=1), (elemIndex=null) firstPos={ 1 } lastPos={ 1 } DFA build: 47ms org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'plnk:partnerLinkType'. One of '{"http://schemas.xmlsoap.org/wsdl/":import, "http://schemas.xmlsoap.org/wsdl/":types, "http://schemas.xmlsoap.org/wsdl/":message, "http://schemas.xmlsoap.org/wsdl/":portType, "http://schemas.xmlsoap.org/wsdl/":binding, "http://schemas.xmlsoap.org/wsdl/":service}' is expected. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:196) at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:132) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:394) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:282) at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:481) at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3571) at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1982) at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:788) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1653) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324) at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:875) at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798) at org.apache.xerces.jaxp.validation.StreamValidatorHelper.validate(StreamValidatorHelper.java:186) at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:129) at javax.xml.validation.Validator.validate(Validator.java:127) at xercestest.XercesTest.main(XercesTest.java:34) BUILD SUCCESSFUL (total time: 0 seconds) In the oneTransition method of the XSDFACM class if the fTransTable contains a -1 one the element is skipped. In the table below fTranTable[2][1] corresponds to the parent any definition which is why the content is being reported as being invalid. fTransTable 0 1,1,2,2,2,2,2,2 1 -1,1,2,2,2,2,2,2 2 -1,-1,2,2,2,2,2,2 Unfortunately I don't fully understand the DFA table generation code fully so I cannot suggest a patch. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org For additional commands, e-mail: j-dev-help@xerces.apache.org