*/
@Override
protected void bindRule( LinkedRuleBuilder linkedRuleBuilder, Attributes attributes )
throws Exception
{
NodeCreateRuleProvider nodeProvider = linkedRuleBuilder.createNode();
String nodeType = attributes.getValue( "type" );
if ( nodeType != null && nodeType.length() > 0 )
{
if ( "element".equals( nodeType ) )
{
nodeProvider.ofType( NodeType.ELEMENT );
}
else if ( "fragment".equals( nodeType ) )
{
nodeProvider.ofType( NodeType.DOCUMENT_FRAGMENT );
}
else
{
throw new RuntimeException( format(
"Unrecognized node type: %s. This attribute is optional or can have a value of element|fragment.",