Refine search
public void writeParam(String name, String value) { if (value == null) return; AttributeListImpl atts = new AttributeListImpl(); atts.addAttribute("name", "CDATA", name); atts.addAttribute("value", "CDATA", value); pp.startElement("param", atts); pp.endElement("param"); }
/** * Set the attribute list, discarding previous contents. * * <p>This method allows an application writer to reuse an * attribute list easily.</p> * * @param atts The attribute list to copy. */ public void setAttributeList (AttributeList atts) { int count = atts.getLength(); clear(); for (int i = 0; i < count; i++) { addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i)); } }
/** * Get the type of an attribute (by name). * * @param name The attribute name. * @return The attribute type as a string ("NMTOKEN" for an * enumeration, and "CDATA" if no declaration was * read). * @see org.xml.sax.AttributeList#getType(java.lang.String) */ public String getType(String name) { return getType(names.indexOf(name)); }
/** * Process an included schema * * @param schema the imported Schema to process * @param schemaPrefix the namespace prefix to use for schema elements **/ private void processIncludedSchema(Schema schema, String schemaPrefix) throws SAXException { String ELEMENT_NAME = schemaPrefix + SchemaNames.INCLUDE; _atts.clear(); String schemaLoc = schema.getSchemaLocation(); _atts.addAttribute("schemaLocation", null, schemaLoc); _handler.startElement(ELEMENT_NAME, _atts); _handler.endElement(ELEMENT_NAME); } // -- processImport
public void produce(final DocumentHandler docHandler) throws SAXException { AttributeListImpl attrList = new AttributeListImpl(); docHandler.startElement(XML.Namespace.ROOT, attrList); attrList = new AttributeListImpl(); if (_baseDN != null) { attrList.addAttribute(Names.Attribute.BASE_DN, "CDATA", _baseDN); attrList.addAttribute(Names.Attribute.FILTER, "CDATA", _filter); attrList.addAttribute(Names.Attribute.SCOPE, null, Names.Attribute.SCOPE_ONE_LEVEL); break; case Scope.BASE: attrList.addAttribute(Names.Attribute.SCOPE, null, Names.Attribute.SCOPE_BASE); break; case Scope.SUB_TREE: attrList.addAttribute(Names.Attribute.SCOPE, null, Names.Attribute.SCOPE_SUB_TREE); break; docHandler.startElement(Names.Element.SEARCH, attrList); attrList = new AttributeListImpl(); attrList.addAttribute(Names.Attribute.ATTRIBUTE_NAME, "NMTOKEN", enumeration.nextElement()); docHandler.startElement(Names.Element.RETURN_ATTRIBUTE, attrList); docHandler.endElement(Names.Element.RETURN_ATTRIBUTE);
AttributeListImpl atts = new AttributeListImpl(); atts.addAttribute("xmlns", "CDATA", "http://www.topicmaps.org/xtm/1.0/"); atts.addAttribute("xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink"); atts.clear(); atts.addAttribute("id", "CDATA", "unifying-topic-" + suffix); ser.startElement("topic", atts); atts.clear(); ser.startElement("subjectIdentity", atts); while (sublociter.hasNext()) { LocatorIF uriloc = sublociter.next(); atts.clear(); atts.addAttribute("xlink:href", "CDATA", uriloc.getExternalForm()); ser.startElement("resourceRef", atts); ser.endElement("resourceRef"); while (srclociter.hasNext()) { LocatorIF uriloc = srclociter.next(); atts.clear(); atts.addAttribute("xlink:href", "CDATA", uriloc.getExternalForm()); ser.startElement("topicRef", atts); ser.endElement("topicRef"); while (indicatoriter.hasNext()) { LocatorIF uriloc = indicatoriter.next(); atts.clear();
public void startDocument() throws SAXException { AttributeListImpl attrList; attrList = new AttributeListImpl(); if ( _namespace ) attrList.addAttribute( "xmlns:" + XML.Namespace.Prefix, "CDATA", XML.Namespace.URI ); else attrList.addAttribute( "xmlns", "CDATA", XML.Namespace.URI ); _docHandler.startElement( prefix( XML.Namespace.Root ), attrList ); }
_atts.clear(); _handler.startElement(ELEM_ANNOTATION, _atts); String sourceName = _atts.getName(0); boolean isSourceIsNull = (sourceName == null); boolean isSourceExists = false; _atts.addAttribute(SchemaNames.SOURCE_ATTR, CDATA, source); _handler.startElement(ELEM_APPINFO, _atts); Enumeration anyNodes = app.getObjects(); while (anyNodes.hasMoreElements()) { } else { char[] chars = obj.toString().toCharArray(); _handler.characters(chars, 0, chars.length); String ELEM_DOCUMENTATION = schemaPrefix + DOCUMENTATION; while (enumeration.hasMoreElements()) { _atts.clear(); Documentation doc = (Documentation) enumeration.nextElement(); String source = doc.getSource(); String sourceName = _atts.getName(0); boolean isSourceIsNull = (sourceName == null); boolean isSourceExists = false; _atts.addAttribute(SchemaNames.SOURCE_ATTR, CDATA, source);
protected void outputEntities(Relation rel, DocumentHandler dh) throws SAXException { AttributeListImpl atts = new AttributeListImpl(); addAttribute(atts, "id", "CDATA", entity.getId()); addAttribute(atts, "type", "CDATA", entity.getAssociationType()); dh.startElement("topic", atts); atts.clear(); dh.endElement("topic"); addAttribute(atts, "scope", "CDATA", entity.getScope()); dh.startElement("association", atts); atts.clear();
protected void enterDirectory() throws SAXException { // If not inside directory element, start it if (!_insideDirectory) { _insideDirectory = true; _docHandler.startElement(prefix(XML.Entries.ELEMENT), new AttributeListImpl()); } }
protected void addAttribute(AttributeListImpl atts, String name, String type, String value) { if (value != null) atts.addAttribute(name, type, value); }
/** * Get the value of an attribute (by name). * * @param name The attribute name. * @return the named attribute's value or null, if the attribute does not * exist. * @see org.xml.sax.AttributeList#getValue(java.lang.String) */ public String getValue(String name) { return getValue(names.indexOf(name)); }
/** * Construct a persistent copy of an existing attribute list. * * <p>This constructor is most useful for application writers, * who will use it to create a persistent copy of an existing * attribute list.</p> * * @param atts The attribute list to copy * @see org.xml.sax.DocumentHandler#startElement */ public AttributeListImpl (AttributeList atts) { setAttributeList(atts); }
/** * Sets the attributes for the wrapped element. * * @param attributes List of attributes defined in the XML for this * element. May be <code>null</code>. * @deprecated since 1.6.x. */ @Deprecated public synchronized void setAttributes(AttributeList attributes) { this.attributes = new AttributeListImpl(attributes); for (int i = 0; i < attributes.getLength(); i++) { setAttribute(attributes.getName(i), attributes.getValue(i)); } }
/** * Process an included schema * * @param schema the imported Schema to process * @param schemaPrefix the namespace prefix to use for schema elements **/ private void processIncludedSchema(Schema schema, String schemaPrefix) throws SAXException { String ELEMENT_NAME = schemaPrefix + SchemaNames.INCLUDE; _atts.clear(); String schemaLoc = schema.getSchemaLocation(); _atts.addAttribute("schemaLocation", null, schemaLoc); _handler.startElement(ELEMENT_NAME, _atts); _handler.endElement(ELEMENT_NAME); } //-- processImport
attrList = new AttributeListImpl(); docHandler.startElement( XML.Namespace.Root, attrList ); attrList = new AttributeListImpl(); if ( _baseDN != null ) attrList.addAttribute( Names.Attribute.BaseDN, "CDATA", _baseDN ); if ( _filter != null ) attrList.addAttribute( Names.Attribute.Filter, "CDATA", _filter ); switch ( _scope ) { case Scope.OneLevel: attrList.addAttribute( Names.Attribute.Scope, null, Names.Attribute.ScopeOneLevel ); break; case Scope.Base: attrList.addAttribute( Names.Attribute.Scope, null, Names.Attribute.ScopeBase ); break; case Scope.SubTree: attrList.addAttribute( Names.Attribute.Scope, null, Names.Attribute.ScopeSubTree ); break; attrList = new AttributeListImpl(); attrList.addAttribute( Names.Attribute.AttrName, "NMTOKEN", (String) enumeration.nextElement() ); docHandler.startElement( Names.Element.ReturnAttr, attrList ); docHandler.endElement( Names.Element.ReturnAttr );
String view) throws SAXException, TMRAPException { AttributeListImpl atts = new AttributeListImpl(); handler.startDocument(); atts.addAttribute("xmlns:x", "CDATA", "http://www.topicmaps.org/xtm/1.0/"); atts.addAttribute("xmlns:l", "CDATA", "http://www.w3.org/1999/xlink"); handler.startElement("result", atts); atts.clear(); handler.startElement("head", atts); for (int ix = 0; ix < result.getWidth(); ix++) { handler.startElement("column", atts);
public void startDocument() throws SAXException { AttributeListImpl attrList; attrList = new AttributeListImpl(); if (_namespace) attrList.addAttribute("xmlns:" + XML.Namespace.PREFIX, "CDATA", XML.Namespace.URI); else attrList.addAttribute("xmlns", "CDATA", XML.Namespace.URI); _docHandler.startElement(prefix(XML.Namespace.ROOT), attrList); }
_atts.clear(); _handler.startElement(ELEM_ANNOTATION, _atts); String sourceName = _atts.getName(0); boolean isSourceIsNull = (sourceName == null); boolean isSourceExists = false; _atts.addAttribute(SchemaNames.SOURCE_ATTR, CDATA,source); _handler.startElement(ELEM_APPINFO, _atts); Enumeration anyNodes = app.getObjects(); while (anyNodes.hasMoreElements()) { _handler.characters(chars, 0, chars.length); String ELEM_DOCUMENTATION = schemaPrefix + DOCUMENTATION; while (enumeration.hasMoreElements()) { _atts.clear(); Documentation doc = (Documentation) enumeration.nextElement(); String source = doc.getSource(); String sourceName = _atts.getName(0); boolean isSourceIsNull = (sourceName == null); boolean isSourceExists = false; _atts.addAttribute(SchemaNames.SOURCE_ATTR, CDATA,source);
protected void outputField(Field field, DocumentHandler dh) throws SAXException { AttributeListImpl atts = new AttributeListImpl(); if (field.getFieldType() == Field.TYPE_SUBJECT_LOCATOR) { addAttribute(atts, "column", "CDATA", field.getColumn()); dh.startElement("subject-locator", atts); char[] c = field.getPattern().toCharArray(); dh.characters(c, 0, c.length); dh.endElement("subject-locator"); atts.clear(); atts.clear(); atts.clear(); atts.clear(); atts.clear(); atts.clear(); atts.clear(); atts.clear(); atts.clear();