Package org.relaxng.datatype

Examples of org.relaxng.datatype.DatatypeException


            if (e instanceof BadAttributeValueException) {
                BadAttributeValueException ex = (BadAttributeValueException) e;
                boolean isWarning = false;
                Map<String, DatatypeException> datatypeErrors = ex.getExceptions();
                for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
                    DatatypeException dex = entry.getValue();
                    if (dex instanceof Html5DatatypeException) {
                        Html5DatatypeException ex5 = (Html5DatatypeException) dex;
                        if (ex5.isWarning()) {
                            isWarning = true;
                        }
View Full Code Here


            messageTextString(messageTextHandler, PERIOD, false);                   
        } else {
            messageTextString(messageTextHandler, COLON, false);                   
            for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
                messageTextString(messageTextHandler, SPACE, false);
                DatatypeException ex = entry.getValue();
                if (ex instanceof Html5DatatypeException) {
                    Html5DatatypeException ex5 = (Html5DatatypeException) ex;
                    String[] segments = ex5.getSegments();
                    for (int i = 0; i < segments.length; i++) {
                        String segment = segments[i];
                        if (i % 2 == 0) {
                            emitStringWithQurlyQuotes(messageTextHandler, segment);                           
                        } else {
                            String scrubbed = scrub(segment);
                            messageTextHandler.startCode();
                            messageTextHandler.characters(scrubbed.toCharArray(), 0, scrubbed.length());
                            messageTextHandler.endCode();
                        }
                    }
                } else {
                    emitStringWithQurlyQuotes(messageTextHandler, ex.getMessage());
                }
            }
        }
    }
View Full Code Here

    }

    private void elaborateDatatypes(Map<String, DatatypeException> map) throws SAXException {
        Set<DocumentFragment> fragments = new HashSet<DocumentFragment>();
        for (Map.Entry<String, DatatypeException> entry : map.entrySet()) {
            DatatypeException ex = entry.getValue();
            if (ex instanceof Html5DatatypeException) {
                Html5DatatypeException ex5 = (Html5DatatypeException) ex;
                DocumentFragment fragment = HTML5_DATATYPE_ADVICE.get(ex5.getDatatypeClass());
                if (fragment != null) {
                    fragments.add(fragment);
View Full Code Here

            exception = e;
            if (e instanceof BadAttributeValueException) {
                BadAttributeValueException ex = (BadAttributeValueException) e;
                Map<String, DatatypeException> datatypeErrors = ex.getExceptions();
                for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
                    DatatypeException dex = entry.getValue();
                    if (dex instanceof Html5DatatypeException) {
                        Html5DatatypeException ex5 = (Html5DatatypeException) dex;
                        if (ex5.isWarning()) {
                            exceptionIsWarning = true;
                            return;
View Full Code Here

        } else if ("image-candidate-strings-width-required".equals(typeLocalName)) {
            return ImageCandidateStringsWidthRequired.THE_INSTANCE;
        } else if ("image-candidate-url".equals(typeLocalName)) {
            return ImageCandidateURL.THE_INSTANCE;
        }
        throw new DatatypeException("Unknown local name for datatype: " + typeLocalName);
    }
View Full Code Here

            throws DatatypeException {
        if ("shortcut".equals(token)) {
            if ("shortcut icon".equals(toAsciiLowerCase(literal))) {
                return true;
            } else {
                throw new DatatypeException("If the \u201cshortcut\u201d"
                        + " keyword is present, the \u201crel\u201d"
                        + " attribute's entire value must be"
                        + " \u201cshortcut icon\u201d.");
            }
        } else {
View Full Code Here

        }
        if (e instanceof BadAttributeValueException) {
          BadAttributeValueException ex = (BadAttributeValueException) e;
          Map<String, DatatypeException> datatypeErrors = ex.getExceptions();
          for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
            DatatypeException dex = entry.getValue();
            if (dex instanceof Html5DatatypeException) {
              Html5DatatypeException ex5 = (Html5DatatypeException) dex;
              if (ex5.isWarning()) {
                this.warnings++;
                throwIfTooManyMessages();
                messageFromSAXParseException(MessageType.WARNING, e, exact);
                return;
              }
            }
          }
        }
        if (e instanceof DatatypeMismatchException) {
          DatatypeMismatchException ex = (DatatypeMismatchException) e;
          Map<String, DatatypeException> datatypeErrors = ex.getExceptions();
          for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
            DatatypeException dex = entry.getValue();
            if (dex instanceof Html5DatatypeException) {
              Html5DatatypeException ex5 = (Html5DatatypeException) dex;
              if (ex5.isWarning()) {
                this.warnings++;
                throwIfTooManyMessages();
View Full Code Here

            messageTextString(messageTextHandler, PERIOD, false);                   
        } else {
            messageTextString(messageTextHandler, COLON, false);                   
            for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
                messageTextString(messageTextHandler, SPACE, false);
                DatatypeException ex = entry.getValue();
                if (ex instanceof Html5DatatypeException) {
                    Html5DatatypeException ex5 = (Html5DatatypeException) ex;
                    String[] segments = ex5.getSegments();
                    for (int i = 0; i < segments.length; i++) {
                        String segment = segments[i];
                        if (i % 2 == 0) {
                            emitStringWithQurlyQuotes(messageTextHandler, segment);                           
                        } else {
                            String scrubbed = scrub(segment);
                            messageTextHandler.startCode();
                            messageTextHandler.characters(scrubbed.toCharArray(), 0, scrubbed.length());
                            messageTextHandler.endCode();
                        }
                    }
                } else {
                    emitStringWithQurlyQuotes(messageTextHandler, ex.getMessage());
                }
            }
        }
    }
View Full Code Here

    }

    private void elaborateDatatypes(Map<String, DatatypeException> map) throws SAXException {
        Set<DocumentFragment> fragments = new HashSet<DocumentFragment>();
        for (Map.Entry<String, DatatypeException> entry : map.entrySet()) {
            DatatypeException ex = entry.getValue();
            if (ex instanceof Html5DatatypeException) {
                Html5DatatypeException ex5 = (Html5DatatypeException) ex;
                DocumentFragment fragment = HTML5_DATATYPE_ADVICE.get(ex5.getDatatypeClass());
                if (fragment != null) {
                    fragments.add(fragment);
View Full Code Here

        } else if ("string-without-line-breaks".equals(typeLocalName)) {
            return StringWithoutLineBreaks.THE_INSTANCE;
        } else if ("simple-color".equals(typeLocalName)) {
            return SimpleColor.THE_INSTANCE;
        }
        throw new DatatypeException("Unknown local name for datatype: " + typeLocalName);
    }
View Full Code Here

TOP

Related Classes of org.relaxng.datatype.DatatypeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.