本文整理汇总了Java中org.w3c.dom.Element.getAttributeNS方法的典型用法代码示例。如果您正苦于以下问题:Java Element.getAttributeNS方法的具体用法?Java Element.getAttributeNS怎么用?Java Element.getAttributeNS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.w3c.dom.Element
的用法示例。
在下文中一共展示了Element.getAttributeNS方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveActiveProfiles
import org.w3c.dom.Element; //导入方法依赖的package包/类
private List<String> retrieveActiveProfiles(AuxiliaryConfiguration ac, boolean shared) {
Set<String> prifileides = new HashSet<String>();
Element element = ac.getConfigurationFragment(PROFILES, NAMESPACE, shared);
if (element != null) {
String activeProfiles = element.getAttributeNS(NAMESPACE, ACTIVEPROFILES);
if (activeProfiles != null && activeProfiles.length() > 0) {
StringTokenizer tokenizer = new StringTokenizer(activeProfiles, SEPARATOR);
while (tokenizer.hasMoreTokens()) {
prifileides.add(tokenizer.nextToken());
}
}
}
return new ArrayList<String>(prifileides);
}
示例2: process
import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.svg.inkscape.ElementProcessor#process(org.newdawn.slick.svg.Loader, org.w3c.dom.Element, org.newdawn.slick.svg.Diagram, org.newdawn.slick.geom.Transform)
*/
public void process(Loader loader, Element element, Diagram diagram,
Transform transform) throws ParsingException {
String ref = element.getAttributeNS("http://www.w3.org/1999/xlink", "href");
String href = Util.getAsReference(ref);
Figure referenced = diagram.getFigureByID(href);
if (referenced == null) {
throw new ParsingException(element, "Unable to locate referenced element: "+href);
}
Transform local = Util.getTransform(element);
Transform trans = local.concatenate(referenced.getTransform());
NonGeometricData data = Util.getNonGeometricData(element);
Shape shape = referenced.getShape().transform(trans);
data.addAttribute(NonGeometricData.FILL, referenced.getData().getAttribute(NonGeometricData.FILL));
data.addAttribute(NonGeometricData.STROKE, referenced.getData().getAttribute(NonGeometricData.STROKE));
data.addAttribute(NonGeometricData.OPACITY, referenced.getData().getAttribute(NonGeometricData.OPACITY));
data.addAttribute(NonGeometricData.STROKE_WIDTH, referenced.getData().getAttribute(NonGeometricData.STROKE_WIDTH));
Figure figure = new Figure(referenced.getType(), shape, data, trans);
diagram.addFigure(figure);
}
示例3: unmarshalParams
import org.w3c.dom.Element; //导入方法依赖的package包/类
private void unmarshalParams(Element paramsElem) {
String prefixListAttr = paramsElem.getAttributeNS(null, "PrefixList");
this.inclusiveNamespaces = prefixListAttr;
int begin = 0;
int end = prefixListAttr.indexOf(' ');
List<String> prefixList = new ArrayList<String>();
while (end != -1) {
prefixList.add(prefixListAttr.substring(begin, end));
begin = end + 1;
end = prefixListAttr.indexOf(' ', begin);
}
if (begin <= prefixListAttr.length()) {
prefixList.add(prefixListAttr.substring(begin));
}
this.params = new ExcC14NParameterSpec(prefixList);
}
示例4: getSignatureMethodURI
import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
* Returns the Signature method URI
*
* @return the Signature method URI
*/
public String getSignatureMethodURI() {
Element signatureElement = this.getSignatureMethodElement();
if (signatureElement != null) {
return signatureElement.getAttributeNS(null, Constants._ATT_ALGORITHM);
}
return null;
}
示例5: getMetaData
import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
* Get the meta data store within an element either in the label or
* id atributes
*
* @param element The element to be processed
* @return The meta data stored
*/
static String getMetaData(Element element) {
String label = element.getAttributeNS(INKSCAPE, "label");
if ((label != null) && (!label.equals(""))) {
return label;
}
return element.getAttribute("id");
}
示例6: getFloatAttribute
import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
* Get a floating point attribute that may appear in either the default or
* SODIPODI namespace
*
* @param element The element from which the attribute should be read
* @param attr The attribute to be read
* @return The value from the given attribute
* @throws ParsingException Indicates the value in the attribute was not a float
*/
static float getFloatAttribute(Element element, String attr) throws ParsingException {
String cx = element.getAttribute(attr);
if ((cx == null) || (cx.equals(""))) {
cx = element.getAttributeNS(SODIPODI, attr);
}
try {
return Float.parseFloat(cx);
} catch (NumberFormatException e) {
throw new ParsingException(element, "Invalid value for: "+attr, e);
}
}
示例7: getPayloadAttributeValue
import org.w3c.dom.Element; //导入方法依赖的package包/类
String getPayloadAttributeValue(QName attNAme) {
if (staxBridge != null) {
return staxBridge.getPayloadAttributeValue(attNAme);
} else {
//not lazy -Just get first child element and return its attribute
Element elem = getFirstChildElement();
if (elem != null) {
return elem.getAttributeNS(attNAme.getNamespaceURI(), attNAme.getLocalPart());
}
}
return null;
}
示例8: getAttributeValueFrom
import org.w3c.dom.Element; //导入方法依赖的package包/类
private static String getAttributeValueFrom(
Element element,
String uri,
String localName,
String prefix,
String qualifiedName) {
String nonzeroLengthUri =
(uri == null || uri.length() == 0) ? null : uri;
boolean mustUseGetAttributeNodeNS = (nonzeroLengthUri != null);
if (mustUseGetAttributeNodeNS) {
if (!element.hasAttributeNS(uri, localName)) {
return null;
}
String attrValue =
element.getAttributeNS(nonzeroLengthUri, localName);
return attrValue;
}
Attr attribute = null;
attribute = element.getAttributeNode(qualifiedName);
return attribute == null ? null : attribute.getValue();
}
示例9: setIdAttributeNS
import org.w3c.dom.Element; //导入方法依赖的package包/类
/**
* Registers the element's attribute specified by the namespace URI and
* local name to be of type ID. The attribute must have a non-empty value.
*
* <p>This implementation uses an internal {@link HashMap} to map the
* attribute's value to the specified element.
*
* @param element the element
* @param namespaceURI the namespace URI of the attribute (specify
* <code>null</code> if not applicable)
* @param localName the local name of the attribute
* @throws IllegalArgumentException if <code>localName</code> is not an
* attribute of the specified element or it does not contain a specific
* value
* @throws NullPointerException if <code>element</code> or
* <code>localName</code> is <code>null</code>
* @see #getElementById
*/
public void setIdAttributeNS(Element element, String namespaceURI,
String localName) {
if (element == null) {
throw new NullPointerException("element is null");
}
if (localName == null) {
throw new NullPointerException("localName is null");
}
String idValue = element.getAttributeNS(namespaceURI, localName);
if (idValue == null || idValue.length() == 0) {
throw new IllegalArgumentException(localName + " is not an " +
"attribute");
}
idMap.put(idValue, element);
}
示例10: getAttribute
import org.w3c.dom.Element; //导入方法依赖的package包/类
protected String getAttribute(Element root, String ns, String attributeName) {
String value = root.getAttributeNS(ns, attributeName);
return (!StringUtils.hasText(value) ? root.getAttribute(attributeName) : value);
}
示例11: getAttribute
import org.w3c.dom.Element; //导入方法依赖的package包/类
public static String getAttribute(Element e, String nsUri, String local) {
if(e.getAttributeNodeNS(nsUri,local)==null) return null;
return e.getAttributeNS(nsUri,local);
}
示例12: getAttrValueNS
import org.w3c.dom.Element; //导入方法依赖的package包/类
public static String getAttrValueNS(Element elem, String nsUri,
String localName) {
return elem.getAttributeNS(nsUri, localName);
}