Search in sources :

Example 1 with XSStringBuilder

use of org.opensaml.xml.schema.impl.XSStringBuilder in project webcert by sklintyg.

the class BaseFakeAuthenticationProvider method createAttribute.

protected Attribute createAttribute(String name, String value) {
    Attribute attribute = new AttributeBuilder().buildObject();
    attribute.setName(name);
    Document doc = documentBuilder.newDocument();
    Element element = doc.createElement("element");
    element.setTextContent(value);
    XMLObject xmlObject = new XSStringBuilder().buildObject(new QName("ns", "local"));
    xmlObject.setDOM(element);
    attribute.getAttributeValues().add(xmlObject);
    return attribute;
}
Also used : AttributeBuilder(org.opensaml.saml2.core.impl.AttributeBuilder) Attribute(org.opensaml.saml2.core.Attribute) QName(javax.xml.namespace.QName) Element(org.w3c.dom.Element) XMLObject(org.opensaml.xml.XMLObject) Document(org.w3c.dom.Document) XSStringBuilder(org.opensaml.xml.schema.impl.XSStringBuilder)

Aggregations

QName (javax.xml.namespace.QName)1 Attribute (org.opensaml.saml2.core.Attribute)1 AttributeBuilder (org.opensaml.saml2.core.impl.AttributeBuilder)1 XMLObject (org.opensaml.xml.XMLObject)1 XSStringBuilder (org.opensaml.xml.schema.impl.XSStringBuilder)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1