Package org.xml.sax.helpers

Examples of org.xml.sax.helpers.AttributesImpl.addAttribute()


        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String qName = "myElement";
        final AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute( "", "", "key", "CDATA", "value" );
        handler.startElement( "", "", qName, attributes );
        handler.endElement( "", "", qName );
        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
        assertEquals( "configuration.location", "", configuration.getLocation() );
View Full Code Here


        throws Exception
    {
        final SAXConfigurationHandler handler = new MockSAXConfigurationHandler();
        final String qName = "myElement";
        final AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute( "", "", "key", "CDATA", "value" );
        handler.startElement( "", "", qName, attributes );
        handler.endElement( "", "", qName );
        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
        assertEquals( "configuration.location", "", configuration.getLocation() );
View Full Code Here

        final String[] names = configuration.getAttributeNames();
        for( int i = 0; i < names.length; i++ )
        {
            final String name = names[ i ];
            final String value = configuration.getAttribute( name, "" );
            attributes.addAttribute( EMPTY_NAMESPACE, name, name,
                                     CDATA_TYPE, value );
        }
        return attributes;
    }
View Full Code Here

    protected void startTokenHighlight(XMLOutput output, String cssClass) throws SAXException
    {
        if (cssClass != null)
        {
            AttributesImpl attributes = new AttributesImpl();
            attributes.addAttribute("", "class", "class", "string", cssClass);
            output.startElement("div", attributes);
        }
    }

    protected void endTokenHighlight(XMLOutput output) throws SAXException
View Full Code Here

                qName = prefix + ':' + localName;
            }
            String type = staxAttr.getDTDType();
            String value = staxAttr.getValue();
           
            attrs.addAttribute(uri, localName, qName, type, value);
        }

        return attrs;
    }
View Full Code Here

          if (attParmList != null) {
            Iterator attsItr = attParmList.iterator();

            while (attsItr.hasNext()) {
              String[] attParms = (String[]) attsItr.next();
              attributes.addAttribute(attParms[0], attParms[1],
                  attParms[2], attParms[3], attParms[4]);
            }
          }

          handler.startElement((String) saxEvent.getParm(0),
View Full Code Here

        for (int i = 0; i < fontRecords.length; i++) {
            FontRecord nextRecord = fontRecords[i];
            attrs.clear();
            String metricsFile = URLDecoder.decode(nextRecord.getMetricsLocation().toString(), "utf-8");
            attrs.addAttribute("", "metrics-file", "metrics-file", "CDATA", metricsFile);
            attrs.addAttribute("", "kerning", "kerning", "CDATA", "yes");
            attrs.addAttribute("", "embed-file", "embed-file", "CDATA",
                    nextRecord.getFontLocation().getPath());
            handler.startElement("", "font", "font", attrs);
            writeTriplets(handler, nextRecord.getFontTriplets());
View Full Code Here

        for (int i = 0; i < fontRecords.length; i++) {
            FontRecord nextRecord = fontRecords[i];
            attrs.clear();
            String metricsFile = URLDecoder.decode(nextRecord.getMetricsLocation().toString(), "utf-8");
            attrs.addAttribute("", "metrics-file", "metrics-file", "CDATA", metricsFile);
            attrs.addAttribute("", "kerning", "kerning", "CDATA", "yes");
            attrs.addAttribute("", "embed-file", "embed-file", "CDATA",
                    nextRecord.getFontLocation().getPath());
            handler.startElement("", "font", "font", attrs);
            writeTriplets(handler, nextRecord.getFontTriplets());
            handler.endElement("", "font", "font");
View Full Code Here

            FontRecord nextRecord = fontRecords[i];
            attrs.clear();
            String metricsFile = URLDecoder.decode(nextRecord.getMetricsLocation().toString(), "utf-8");
            attrs.addAttribute("", "metrics-file", "metrics-file", "CDATA", metricsFile);
            attrs.addAttribute("", "kerning", "kerning", "CDATA", "yes");
            attrs.addAttribute("", "embed-file", "embed-file", "CDATA",
                    nextRecord.getFontLocation().getPath());
            handler.startElement("", "font", "font", attrs);
            writeTriplets(handler, nextRecord.getFontTriplets());
            handler.endElement("", "font", "font");
        }
View Full Code Here

            FontTriplet[] fontTriplets) throws SAXException {
        AttributesImpl attrs = new AttributesImpl();
        for (int i = 0; i < fontTriplets.length; i++) {
            FontTriplet next = fontTriplets[i];
            attrs.clear();
            attrs.addAttribute("", "name", "name", "CDATA", next.getName());
            attrs.addAttribute("", "style", "style", "CDATA", next.isItalic()
                    ? "italic"
                    : "normal");
            attrs.addAttribute("", "weight", "weight", "CDATA", next.isBold()
                    ? "bold"
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.