Package org.codehaus.stax2.validation

Examples of org.codehaus.stax2.validation.XMLValidationProblem


        throws Exception
    {
        Document doc = createDomDoc(false);
        // let's use namespace-aware just because some impls might not support non-ns
        XMLOutputFactory of = getFactory(TYPE_NS);
        TypedXMLStreamWriter sw = (TypedXMLStreamWriter) of.createXMLStreamWriter(new DOMResult(doc));

        sw.writeStartDocument();
        sw.writeStartElement("root");
        sw.writeIntAttribute(null, null, "attr", -900);
        sw.writeInt(123);
        sw.writeEndElement();
        sw.writeEndDocument();
        sw.close();

        Element root = doc.getDocumentElement();

        assertNotNull(root);
        assertEquals("root", root.getTagName());
View Full Code Here


        assertTokenType(DTD, sr.next());

        DTDInfo info = sr.getDTDInfo();
        assertNotNull(info);
        DTDValidationSchema dtd = info.getProcessedDTDSchema();
        assertNotNull(dtd);

        // 4 entities, but one is parameter entity...
        assertEquals(3, dtd.getEntityCount());

        // 2 notations:
        assertEquals(2, dtd.getNotationCount());

        // Also, don't want a creepy exception afterwards...
        assertTokenType(START_ELEMENT, sr.next());
    }
View Full Code Here

    protected XMLValidator addValidator(XMLValidator vld)
    {
        if (mValidator == null) {
            mValidator = vld;
        } else {
            mValidator = new ValidatorPair(mValidator, vld);
        }
        return vld;
    }
View Full Code Here

    {
        if (rep != null) {
            /* Note: since the problem occurs at DTD (schema) parsing,
             * not during validation, can not set reporter.
             */
            XMLValidationProblem prob = new XMLValidationProblem
                (loc, msg, XMLValidationProblem.SEVERITY_WARNING, probType);
            rep.report(msg, probType, prob, loc);
        }
    }
View Full Code Here

        throws XMLStreamException
    {
        if (loc == null) {
            loc = getLastCharLocation();
        }
        _reportProblem(rep, new XMLValidationProblem(loc, msg, XMLValidationProblem.SEVERITY_ERROR, probType));
    }
View Full Code Here

    }

    public void reportValidationProblem(String msg, int severity)
        throws XMLStreamException
    {
        reportValidationProblem(new XMLValidationProblem(getLastCharLocation(),
                                                         msg, severity));
    }
View Full Code Here

    }

    public void reportValidationProblem(String msg)
        throws XMLStreamException
    {
        reportValidationProblem(new XMLValidationProblem(getLastCharLocation(),
                                                         msg,
                                                         XMLValidationProblem.SEVERITY_ERROR));
    }
View Full Code Here

    }

    public void reportValidationProblem(Location loc, String msg)
        throws XMLStreamException
    {
        reportValidationProblem(new XMLValidationProblem(loc, msg));
    }
View Full Code Here

    }

    public static WstxValidationException create(String msg, Location loc,
                                                 int severity)
    {
        return create(new XMLValidationProblem(loc, msg, severity));
    }
View Full Code Here

    }

    public void reportValidationProblem(String msg, Location loc, int severity)
        throws XMLValidationException
    {
        reportValidationProblem(new XMLValidationProblem(loc, msg, severity));
    }
View Full Code Here

TOP

Related Classes of org.codehaus.stax2.validation.XMLValidationProblem

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.