private void reportSharingError(String namespace, String name) { final String qName = (namespace == null) ? "," + name : namespace + "," + name; reportSchemaError("sch-props-correct.2", new Object [] {qName}, null); }
public void reportSchemaError(String key, Object[] args, Element ele) { reportSchemaError(key, args, ele, null); }
void reportSchemaError (String key, Object[] args, Element ele) { fSchemaHandler.reportSchemaError(key, args, ele); }
void reportSchemaError (String key, Object[] args, Element ele) { fSchemaHandler.reportSchemaError(key, args, ele); }
/** * Create a new OverrideElemnt and record it into <override> components */ private void addOverrideElement(int componentType, Element elem) { final String cName = DOMUtil.getAttrValue(elem, SchemaSymbols.ATT_NAME); final HashMap cMap = fOverrideComponentsMap[componentType]; if (cMap.get(cName) != null) { fSchemaHandler.reportSchemaError("sch-props-correct.2", new Object []{cName}, elem); } else { OverrideElement e = new OverrideElement(componentType, elem,cName); fOverrideComponents.add(e); cMap.put(cName, e); } }
void checkForDuplicateNames(String qName, int declType, Element currComp) { int namespaceEnd = qName.indexOf(','); String namespace = qName.substring(0, namespaceEnd); SchemaGrammar grammar = fGrammarBucket.getGrammar(emptyString2Null(namespace)); if (grammar != null) { Object obj = getGlobalDeclFromGrammar(grammar, declType, qName.substring(namespaceEnd + 1)); if (obj != null) { reportSchemaError("sch-props-correct.2", new Object []{qName}, currComp); } } }
switch (type) { case ATTRIBUTEGROUP_TYPE: reportSchemaError("src-redefine.7.2.1", new Object []{name.localpart}, elmNode); break; case GROUP_TYPE: reportSchemaError("src-redefine.6.2.1", new Object []{name.localpart}, elmNode); break;
if (!((maxOccurs.length() == 0 || maxOccurs.equals("1")) && (minOccurs.length() == 0 || minOccurs.equals("1")))) { reportSchemaError("src-redefine.6.1.2", new Object [] {ref}, child);
/** * Error handling code shared between the various getSchemaDocument() methods. */ private Element getSchemaDocument1(boolean mustResolve, boolean hasInput, XMLInputSource schemaSource, Element referElement, IOException ioe) { // either an error occured (exception), or empty input source was // returned, we need to report an error or a warning if (mustResolve) { if (hasInput) { reportSchemaError("schema_reference.4", new Object[]{schemaSource.getSystemId()}, referElement, ioe); } else { reportSchemaError("schema_reference.4", new Object[]{schemaSource == null ? "" : schemaSource.getSystemId()}, referElement, ioe); } } else if (hasInput) { reportSchemaWarning("schema_reference.4", new Object[]{schemaSource.getSystemId()}, referElement, ioe); } fLastSchemaWasDuplicate = false; return null; } // getSchemaDocument1(boolean, boolean, XMLInputSource, Element): Element
Element grandKid = DOMUtil.getFirstChildElement(child); if (grandKid == null) { reportSchemaError("src-redefine.5.a.a", null, child); reportSchemaError("src-redefine.5.a.a", null, child); reportSchemaError("src-redefine.5.a.b", new Object[]{grandKidName}, child); derivedBase.uri != currSchema.fTargetNamespace || !derivedBase.localpart.equals(oldName)) { reportSchemaError("src-redefine.5.a.c", new Object[]{grandKidName, (currSchema.fTargetNamespace==null?"":currSchema.fTargetNamespace) Element grandKid = DOMUtil.getFirstChildElement(child); if (grandKid == null) { reportSchemaError("src-redefine.5.b.a", null, child); reportSchemaError("src-redefine.5.b.a", null, child); reportSchemaError("src-redefine.5.b.b", null, grandKid); reportSchemaError("src-redefine.5.b.b", null, grandKid); if (!greatGrandKidName.equals(SchemaSymbols.ELT_RESTRICTION) && !greatGrandKidName.equals(SchemaSymbols.ELT_EXTENSION)) { reportSchemaError("src-redefine.5.b.c", new Object[]{greatGrandKidName}, greatGrandKid); derivedBase.uri != currSchema.fTargetNamespace ||
reportSchemaError("sch-props-correct.2", new Object[]{qName}, currComp); return; reportSchemaError("sch-props-correct.2", new Object [] {qName}, currComp); reportSchemaError("sch-props-correct.2", new Object []{qName}, currComp);
private XMLInputSource resolveSchemaSource(XSDDescription desc, boolean mustResolve, Element referElement, boolean usePairs) { XMLInputSource schemaSource = null; try { Hashtable pairs = usePairs ? fLocationPairs : EMPTY_TABLE; schemaSource = XMLSchemaLoader.resolveDocument(desc, pairs, fEntityResolver); } catch (IOException ex) { if (mustResolve) { reportSchemaError("schema_reference.4", new Object[]{desc.getLocationHints()[0]}, referElement); } else { reportSchemaWarning("schema_reference.4", new Object[]{desc.getLocationHints()[0]}, referElement); } } return schemaSource; }
/** * Check original schema root for possible collision * * @param schemaId The system id of the schema * @param schemaRoot The root of the schema */ public void checkSchemaRoot(String schemaId, Element decl, Element schemaRoot) { final String schemaIdString = nullToEmptyString(schemaId); if (includeSchemaDependencies(schemaIdString, schemaRoot, DocumentContext.IS_ORIGINAL)) { fCurrentState = STATE_INCLUDE; return; } DocumentContext dCtxt = getDocumentMapForSystemId(schemaIdString); Iterator mappedRoots = dCtxt.getSchemaArray(); // for each schema root stored in the context compare for duplicates while (mappedRoots.hasNext()){ final Element mRoot = (Element) mappedRoots.next(); if (DocumentContext.IS_ORIGINAL == dCtxt.getSchemaState(mRoot)) { fCurrentState = STATE_DUPLICATE; return; } } // We have a collision - schema id was overridden fCurrentState = STATE_COLLISION; fSchemaHandler.reportSchemaError("src-override-collision.1", new Object [] { schemaId, DOMUtil.getLocalName(decl)}, decl); }
/** * Register elements of the <override> schema component for later processing */ private void fillOverrideElementMap(Element overrideElement){ for (Element child = DOMUtil.getFirstChildElement(overrideElement); child != null; child = DOMUtil.getNextSiblingElement(child)){ final String localName = getLocalName(child); if (localName.equals(SchemaSymbols.ELT_ANNOTATION)){ continue; } else { final int componentOverrideType = getOverrideType(localName); if (componentOverrideType != 0) { addOverrideElement(componentOverrideType, child); } else { fSchemaHandler.reportSchemaError("s4s-elt-must-match.1", new Object[]{"override", "(annotation | (simpleType | complexType | group | attributeGroup | element | attribute | notation))*", DOMUtil.getLocalName(child)}, child); } } } }
fSchemaHandler.reportSchemaError("src-override-collision.2", new Object [] { schemaId }, decl); return false;
(DOMUtil.getLocalName(globalComp).equals(SchemaSymbols.ELT_OVERRIDE) && fSchemaVersion == Constants.SCHEMA_VERSION_1_1)) { if (!dependenciesCanOccur) { reportSchemaError("s4s-elt-invalid-content.3", new Object [] {DOMUtil.getLocalName(globalComp)}, globalComp); reportSchemaError("s4s-elt-invalid-content.3", new Object [] {DOMUtil.getLocalName(globalComp)}, globalComp); reportSchemaError("s4s-elt-invalid-content.3", new Object [] {componentType}, globalComp);
reportSchemaError("s4s-elt-must-match.1", new Object [] {DOMUtil.getLocalName(globalComp), "(annotation | (simpleType | complexType | group | attributeGroup))*", redefinedComponentType}, redefinedComp); reportSchemaError("s4s-elt-invalid-content.1", new Object [] {SchemaSymbols.ELT_SCHEMA, DOMUtil.getLocalName(globalComp)}, globalComp);
protected XPath compileXPathStr(String xpathStr, XSAssertImpl assertImpl, XSDHandler fSchemaHandler, Element schemaContextElem) { XPathParser xpathParser = new JFlexCupParser(); XPath xpathObject = null; try { xpathObject = xpathParser.parse("boolean(" + xpathStr + ")", true); } catch (XPathParserException ex) { // XPath parser exception if (SchemaSymbols.XS11_XPATHEXPR_COMPILE_WRN_MESG_1.equals(ex.getMessage())) { fSchemaHandler.reportSchemaWarning("cvc-xpath.3.13.4.2b", new Object[] {assertImpl.getTest().getXPathStr(), XS11TypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())}, schemaContextElem); } else { fSchemaHandler.reportSchemaError("cvc-xpath.3.13.4.2a", new Object[] {assertImpl.getTest().getXPathStr(), XS11TypeHelper.getSchemaTypeName(assertImpl.getTypeDefinition())}, schemaContextElem); } } return xpathObject; } // compileXPathStr
fSymbolTable, fTypeValidatorHelper, datatypeXMLVersion); } catch (XMLSchemaException se) { reportSchemaError(ELE_ERROR_CODES[referType], new Object[]{locationHint}, schemaRoot); reportSchemaError(NS_ERROR_CODES[referType][secondIdx], new Object [] {callerTNS, currSchemaInfo.fTargetNamespace}, schemaRoot); reportSchemaError(NS_ERROR_CODES[referType][secondIdx], new Object [] {callerTNS, currSchemaInfo.fTargetNamespace}, schemaRoot); reportSchemaError(NS_ERROR_CODES[referType][secondIdx], new Object [] {callerTNS, currSchemaInfo.fTargetNamespace}, schemaRoot); fElementTraverser.traverseAnnotationDecl(importChild, importAttrs, true, currSchemaInfo)); } else { reportSchemaError("s4s-elt-must-match.1", new Object [] {localName, "annotation?", importComponentType}, child); reportSchemaError("s4s-elt-must-match.1", new Object [] {localName, "annotation?", DOMUtil.getLocalName(DOMUtil.getNextSiblingElement(importChild))}, child); reportSchemaError(schemaNamespace != null ? "src-import.1.1" : "src-import.1.2", new Object [] {schemaNamespace}, child); continue; fElementTraverser.traverseAnnotationDecl(includeChild, includeAttrs, true, currSchemaInfo));
reportSchemaError("schema_reference.4", new Object[]{desc.getLocationHints()[0]}, referElement);