Example usage for org.dom4j.tree DefaultAttribute DefaultAttribute

List of usage examples for org.dom4j.tree DefaultAttribute DefaultAttribute

Introduction

In this page you can find the example usage for org.dom4j.tree DefaultAttribute DefaultAttribute.

Prototype

public DefaultAttribute(String name, String value, Namespace namespace) 

Source Link

Document

Creates the Attribute with the specified local name, value and Namespace.

Usage

From source file:net.sf.saxon.option.dom4j.DOM4JWriter.java

License:Mozilla Public License

public void attribute(NodeName nameCode, SimpleType typeCode, CharSequence value, int locationId,
        int properties) throws XPathException {
    String local = nameCode.getLocalPart();
    String uri = nameCode.getURI();
    String prefix = nameCode.getPrefix();
    Namespace ns = new Namespace(prefix, uri);
    Attribute att = new DefaultAttribute(local, value.toString(), ns);
    ((Element) ancestors.peek()).add(att);
}