Examples of Attributes2Impl


Examples of org.xml.sax.ext.Attributes2Impl

       
        // Check if any of the attributes are to be filtered if so, filter them out.
        if (!filterAttributeIndexes.isEmpty())
        {
          // New set of attributes.
          Attributes2Impl a2 = new Attributes2Impl();
         
          for (int i = 0; i < a.getLength(); i++)
          {
            if (filterAttributeIndexes.contains(i))
                    {
                        // This index is to be filtered.
                        continue;
                    }
           
            String a_uri = a.getURI(i);
            String a_localName = a.getLocalName(i);
            String a_qName = a.getQName(i);
            String a_type = a.getType(i);
            String a_value = a.getValue(i);
           
            // Add the new attribute
            a2.addAttribute(a_uri, a_localName, a_qName, a_type, a_value);
          }
         
          // Use our new filtered attributes.
          a = a2;
        }
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

        // TODO
      }
    context.addFirst(typeInfo);
    // attributes
    int len = atts.getLength();
    Attributes2Impl atts2 = new Attributes2Impl();
    int count = 0;
    for (int i = 0; i < len; i++)
      {
        String attUri = atts.getURI(i);
        String attLocalName = atts.getLocalName(i);
        String attQName = atts.getQName(i);
        String attValue = atts.getValue(i);

        if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(attUri))
          {
            continue; // ?
          }

        QName attName = new QName(attUri, attLocalName);
        AttributeDeclaration attDecl =
          (AttributeDeclaration) schema.attributeDeclarations.get(attName);
        boolean declared = (attDecl != null);

        String attType = (attDecl != null) ?
          attDecl.datatype.toString() : "CDATA";
        XMLSchemaAttributeTypeInfo attTypeInfo =
          new XMLSchemaAttributeTypeInfo(schema, attDecl, true);
        attributes.add(attTypeInfo);

        atts2.addAttribute(attUri, attLocalName, attQName, attType, attValue);
        atts2.setDeclared(count, declared);
        atts2.setSpecified(count, true);
        count++;
      }
    // add defaulted attributes to atts2
    // TODO
    // atts2.setSpecified(count, false);
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

    }

    @Test
    public void testGenericValidatorContentHandlerStartElement1() throws Throwable {
        GenericValidatingPackager.GenericValidatorContentHandler genericValidatorContentHandler = new GenericValidatingPackager().new GenericValidatorContentHandler();
        Attributes atts = new Attributes2Impl();
        genericValidatorContentHandler.startElement("testGenericValidatorContentHandlerNamespaceURI",
                "testGenericValidatorContentHandlerLocalName", "testGenericValidatorContentHandlerQName", atts);
    }
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

    }

    @Test
    public void testGenericValidatorContentHandlerStartElementThrowsSAXException10() throws Throwable {
        GenericValidatingPackager.GenericValidatorContentHandler genericValidatorContentHandler = new GenericValidatingPackager().new GenericValidatorContentHandler();
        Attributes atts = new Attributes2Impl();
        try {
            genericValidatorContentHandler.startElement("testGenericValidatorContentHandlerNamespaceURI", "isopackager",
                    "testGenericValidatorContentHandlerQName", atts);
            fail("Expected SAXException to be thrown");
        } catch (SAXException ex) {
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

    }

    @Test
    public void testGenericValidatorContentHandlerStartElementThrowsSAXException2() throws Throwable {
        GenericValidatingPackager.GenericValidatorContentHandler genericValidatorContentHandler = new GenericValidatingPackager().new GenericValidatorContentHandler();
        Attributes atts = new Attributes2Impl();
        try {
            genericValidatorContentHandler.startElement("testGenericValidatorContentHandlerNamespaceURI", null,
                    "testGenericValidatorContentHandlerQName", atts);
            fail("Expected SAXException to be thrown");
        } catch (SAXException ex) {
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

    @Test
    public void testGenericContentHandlerEndElementThrowsClassCastException() throws Throwable {
        GenericPackager.GenericContentHandler genericContentHandler = new GenericPackager().new GenericContentHandler();
        genericContentHandler.startDocument();
        Attributes atts = new AttributesImpl(new Attributes2Impl());
        genericContentHandler.startElement("testGenericContentHandlerNamespaceURI", "isopackager", "testGenericContentHandlerQName",
                atts);
        genericContentHandler.startElement("testGenericContentHandlerNamespaceURI1", "isopackager",
                "testGenericContentHandlerQName1", atts);
        try {
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

    }

    @Test
    public void testGenericContentHandlerStartElementThrowsSAXException2() throws Throwable {
        GenericPackager.GenericContentHandler genericContentHandler = new GenericSubFieldPackager().new GenericContentHandler();
        Attributes atts = new Attributes2Impl();
        try {
            genericContentHandler
                    .startElement("testGenericContentHandlerNamespaceURI", null, "testGenericContentHandlerQName", atts);
            fail("Expected SAXException to be thrown");
        } catch (SAXException ex) {
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

    }

    @Test
    public void testGenericContentHandlerStartElementThrowsSAXException4() throws Throwable {
        GenericPackager.GenericContentHandler genericContentHandler = new X92GenericPackager().new GenericContentHandler();
        Attributes atts = new Attributes2Impl();
        try {
            genericContentHandler.startElement("testGenericContentHandlerNamespaceURI", "isofieldpackager",
                    "testGenericContentHandlerQName", atts);
            fail("Expected SAXException to be thrown");
        } catch (SAXException ex) {
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

    @Before
    public void onSetup() throws ISOException, NoSuchFieldException {
        // PrintStream p = new PrintStream(new ByteArrayOutputStream())
        xMLPackager = new XMLPackager();
        atts = new Attributes2Impl();
        logger = new Logger();
        logger.addListener(new SimpleLogListener());
        isoMsg = xMLPackager.createISOMsg();
        xMLPackager.setLogger(logger, xMLPackager.getClass().getName());
        isoMsg.setPackager(xMLPackager);
View Full Code Here

Examples of org.xml.sax.ext.Attributes2Impl

        }
    }

    @Test
    public void testStartElementThrowsNullPointerException() throws Throwable {
        Attributes atts = new Attributes2Impl();
        try {
            xMLPackager.startElement("testXMLPackagerNs", null, "testXMLPackagerQName", atts);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.