Object value = assertion.getAssertionValue();
if ( value != null )
{
if ( ParserUtils.needsBase64Encoding( value ) )
{
Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI );
Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI );
element.getDocument().getRootElement().add( xsdNamespace );
element.getDocument().getRootElement().add( xsiNamespace );
Element valueElement =
newElement.addElement( "value" ).addText( ParserUtils.base64Encode( value ) );
valueElement
.addAttribute( new QName( "type", xsiNamespace ), "xsd:" + ParserUtils.BASE64BINARY );
}
else
{
newElement.addElement( "value" ).setText( (String) value );
}
}
}
}
// PRESENT FILTER
else if ( filter instanceof PresentFilter )
{
Element newElement = element.addElement( "present" );
newElement.addAttribute( "name", ( ( PresentFilter ) filter ).getAttributeDescription() );
}
// EXTENSIBLEMATCH
else if ( filter instanceof ExtensibleMatchFilter )
{
Element newElement = element.addElement( "extensibleMatch" );
ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
Object value = extensibleMatchFilter.getMatchValue();
if ( value != null )
{
if ( ParserUtils.needsBase64Encoding( value ) )
{
Namespace xsdNamespace = new Namespace( "xsd", ParserUtils.XML_SCHEMA_URI );
Namespace xsiNamespace = new Namespace( "xsi", ParserUtils.XML_SCHEMA_INSTANCE_URI );
element.getDocument().getRootElement().add( xsdNamespace );
element.getDocument().getRootElement().add( xsiNamespace );
Element valueElement =
newElement.addElement( "value" ).addText( ParserUtils.base64Encode( value ) );