Refine search
QName qname, XMLAttributes attributes) { this.element = element; this.qname = new QName(qname); if (attributes != null) { int length = attributes.getLength(); if (length > 0) { QName aqname = new QName(); XMLAttributes newattrs = new XMLAttributesImpl(); for (int i = 0; i < length; i++) { attributes.getName(i, aqname);
public int addAttribute(QName name, String type, String value) { return attributes.addAttribute(name, type, value); }
private void fillXMLAttributes(StartElement event) { fAttributes.removeAllAttributes(); final Iterator attrs = event.getAttributes(); while (attrs.hasNext()) { Attribute attr = (Attribute) attrs.next(); fillQName(fAttributeQName, attr.getName()); String type = attr.getDTDType(); int idx = fAttributes.getLength(); fAttributes.addAttributeNS(fAttributeQName, (type != null) ? type : XMLSymbols.fCDATASymbol, attr.getValue()); fAttributes.setSpecified(idx, attr.isSpecified()); } }
/** * Look up an attribute's value by Namespace name. * * <p>See {@link #getValue(int) getValue(int)} for a description * of the possible values.</p> * * @param uri The Namespace URI, or null if the * @param localName The local name of the attribute. * @return The attribute value as a string, or null if the * attribute is not in the list. */ public String getValue(String uri, String localName) { int index = getIndex(uri, localName); return index != -1 ? getValue(index) : null; } // getValue(String,String):String
/** Fills in the XMLAttributes object. */ private void fillXMLAttributes(Attributes att) { fAttributes.removeAllAttributes(); final int len = att.getLength(); for (int i = 0; i < len; ++i) { fillXMLAttribute(att, i); fAttributes.setSpecified(i, true); } }
private void fillXMLAttributes(Attributes atts) { fAttributes.removeAllAttributes(); final int attrCount = atts.getLength(); for (int i = 0; i < attrCount; ++i) { fillQName(fAttributeQName, atts.getURI(i), atts.getLocalName(i), atts.getQName(i)); String type = atts.getType(i); fAttributes.addAttributeNS(fAttributeQName, (type != null) ? type : XMLSymbols.fCDATASymbol, atts.getValue(i)); fAttributes.setSpecified(i, true); } }
fQName.setValues(null, aname, aname, null); attributes.addAttribute(fQName, "CDATA", ""); attributes.setSpecified(attributes.getLength()-1, true); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); fQName.setValues(null, aname, aname, null); attributes.addAttribute(fQName, "CDATA", ""); attributes.setSpecified(attributes.getLength()-1, true); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); fQName.setValues(null, aname, aname, null); String avalue = fStringBuffer.toString(); attributes.addAttribute(fQName, "CDATA", avalue); int lastattr = attributes.getLength()-1; attributes.setSpecified(lastattr, true); attributes.setNonNormalizedValue(lastattr, fNonNormAttr.toString()); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); attributes.addAttribute(fQName, "CDATA", avalue); int lastattr = attributes.getLength()-1; attributes.setSpecified(lastattr, true); attributes.setNonNormalizedValue(lastattr, fNonNormAttr.toString()); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1);
int beginColumnNumber = fBeginColumnNumber; int beginCharacterOffset = fBeginCharacterOffset; fAttributes.removeAllAttributes(); int aindex = 0; while (scanPseudoAttribute(fAttributes)) { if (fAttributes.getValue(aindex).length() == 0) { fAttributes.removeAttributeAt(aindex); fAttributes.getName(aindex,fQName); fQName.rawname = fQName.rawname.toLowerCase(); fAttributes.setName(aindex,fQName); aindex++; String version = fAttributes.getValue("version"); String encoding = fAttributes.getValue("encoding"); String standalone = fAttributes.getValue("standalone");
fAttributes.removeAllAttributes(); do { int length = fAttributes.getLength(); fAttributes.getName(i, fAttributeQName); XMLErrorReporter.SEVERITY_FATAL_ERROR); fAttributes.setURI(i, uri); QName name = fAttributes.checkDuplicatesNS(); if (name != null) { if (name.uri != null) {
attrIndex = attributes.getLength(); attributes.addAttributeNS(fAttributeQName, XMLSymbols.fCDATASymbol, null); int oldLen = attributes.getLength(); attrIndex = attributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol, null); if (oldLen == attributes.getLength()) { reportFatalError("AttributeNotUnique", new Object[]{fCurrentElement.rawname, attributes.setValue(attrIndex, value); attributes.setNonNormalizedValue(attrIndex, fTempString2.toString()); attributes.setSpecified(attrIndex, true); attributes.setURI(attrIndex, fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS)); attributes.setURI(attrIndex, fNamespaceContext.getURI(fAttributeQName.prefix));
private XMLAttributes getAttributesForCTA(XMLAttributes attributes, Vector inheritableAttrList) { XMLAttributes ctaAttributes = new XMLAttributesImpl(); // copy attributes from the original list of attributes for (int attrIndx = 0; attrIndx < attributes.getLength(); attrIndx++) { QName attrQName = new QName(); attributes.getName(attrIndx, attrQName); ctaAttributes.addAttribute(attrQName, attributes.getType(attrIndx), attributes.getValue(attrIndx)); } // add inherited attributes to the CTA attributes list for (int elemIndx = inheritableAttrList.size() - 1; elemIndx > -1; elemIndx--) { AttributePSVI inhAttrPsvi = (AttributePSVI) inheritableAttrList.elementAt(elemIndx); XSAttributeDeclaration inhrAttrDecl = inhAttrPsvi.getAttributeDeclaration(); // if an inherited attribute is not overridden by the current element, add it to the CTA attributes list if (!isInheritedAttributeOverridden(ctaAttributes, inhrAttrDecl)) { QName attrQName = new QName(); attrQName.setValues(null, inhrAttrDecl.getName(), inhrAttrDecl.getName(), inhrAttrDecl.getNamespace()); ctaAttributes.addAttribute(attrQName, null, inhAttrPsvi.getSchemaValue().getNormalizedValue()); } } return ctaAttributes; } // getAttributesForCTA
fAttributes.removeAllAttributes(); int beginLineNumber = fBeginLineNumber; int beginColumnNumber = fBeginColumnNumber; fQName.setValues(null, ename, ename, null); if (DEBUG_CALLBACKS) { System.out.println("startElement("+fQName+','+fAttributes+")");
new QName(null, currDecl.fName, currDecl.fName, currDecl.fTargetNamespace); String normalized = (defaultValue != null) ? defaultValue.stringValue() : ""; int attrIndex; if (attributes instanceof XMLAttributesImpl) { XMLAttributesImpl attrs = (XMLAttributesImpl) attributes; attrIndex = attrs.getLength(); attrs.addAttributeNS(attName, "CDATA", normalized);
rawname = XMLSymbols.PREFIX_XMLNS; fAttributeQName.setValues(prefix, localpart, rawname, NamespaceContext.XMLNS_URI); fAttributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol, (nsURI != null) ? nsURI : XMLSymbols.EMPTY_STRING);
/** Fills in the XMLAttributes object. */ private void fillXMLAttributes2(Attributes2 att) { fAttributes.removeAllAttributes(); final int len = att.getLength(); for (int i = 0; i < len; ++i) { fillXMLAttribute(att, i); fAttributes.setSpecified(i, att.isSpecified(i)); if (att.isDeclared(i)) { fAttributes.getAugmentations(i).putItem(Constants.ATTRIBUTE_DECLARED, Boolean.TRUE); } } }
attributes = new XMLAttributesImpl(); attributes = new XMLAttributesImpl(); == null) { if (attributes == null) { attributes = new XMLAttributesImpl(); QName ns = (QName)NEW_NS_ATTR_QNAME.clone(); ns.prefix = null; ns.localpart = XMLSymbols.PREFIX_XMLNS; == null) { if (attributes == null) { attributes = new XMLAttributesImpl(); QName ns = (QName)NEW_NS_ATTR_QNAME.clone(); ns.localpart = prefix; ns.rawname += prefix;
for (int attrIdx = 0; attrIdx < attrsImpl.getLength(); attrIdx++) { Augmentations attrAugs = attrsImpl.getAugmentations(attrIdx); attrAugs.putItem(XSAssertConstants.isAssertProcNeededForUnionAttr, fIsAssertProcessingNeededForSTUnionAttrs.get(attrIdx));
public void removeAllAttributes() { attributes.removeAllAttributes(); }
public void getName(int attrIndex, QName attrName) { attributes.getName(attrIndex, attrName); }
public void setNonNormalizedValue(int attrIndex, String attrValue) { attributes.setNonNormalizedValue(attrIndex, attrValue); }