Example #1
0
 void XemProcessor::xemFunctionVariable ( __XProcFunctionArgs__ )
 {
   if ( args.size() != 1 )
     {
       throwXemProcessorException("Invalid number of arguments for xem:variable() !");
     }
   NodeSet* ns = args[0];
   if ( ns->size() != 1 )
     {
       throwXemProcessorException("Invalid number of nodes for first argument of xem:variable() !");
     }
   if ( ! ns->front().isAttribute() )
     {
       throwXemProcessorException("Argument of xem:variable() is not an attribute !");
     }
   AttributeRef attrRef = ns->front().toAttribute();
   KeyId keyId = attrRef.getElement().getAttrAsKeyId(getXProcessor(),attrRef.getKeyId());
   Log_XemCommon ( "Selected attr=%x\n", keyId );
   NodeSet* variable = getXProcessor().getVariable(keyId);
   variable->copyTo(result);
 }