<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 5/6/2016 4:43 PM, Jim Fox wrote:<br>
    <blockquote cite="mid:alpine.DEB.2.10.1605061443230.28139@x315"
      type="cite">
      <br>
      <blockquote type="cite">Obviously I could make an
        AttributeFilterPolicy with an appropriate PolicyRequirementRule
        limiting application to the particular SP, and then
        <br>
        explicitly list every attribute in an AttributeRule
        individually, but ow, my wrists.
        <br>
        <br>
        Is there a simpler way to do this?
        <br>
        <br>
      </blockquote>
      <br>
      Some combination of grep, sed, awk, echo.
      <br>
    </blockquote>
    <br>
    I ended up using Perl since it's what I know best.<br>
    <br>
    <tt>#!/usr/bin/perl</tt><tt><br>
    </tt><tt>#</tt><tt><br>
    </tt><tt># usage: find_attrs $IDP_HOME/conf/attribute-resolver.xml</tt><tt><br>
    </tt><tt># output: AttributeRules to paste into filter file</tt><tt><br>
    </tt><tt><br>
    </tt><tt>use strict;</tt><tt><br>
    </tt><tt>use <a class="moz-txt-link-freetext" href="XML::Parser">XML::Parser</a>;</tt><tt><br>
    </tt><tt><br>
    </tt><tt>my $parser = new <a class="moz-txt-link-freetext" href="XML::Parser">XML::Parser</a> ( Handlers => { Start =>
      \&h_start });</tt><tt><br>
    </tt><tt>$parser->parsefile(shift);</tt><tt><br>
    </tt><tt><br>
    </tt><tt>sub h_start {</tt><tt><br>
    </tt><tt>  my ($p, $elt, %attr) = @_;</tt><tt><br>
    </tt><tt>  if ($elt eq 'resolver:AttributeDefinition') {</tt><tt><br>
    </tt><tt>    print '<AttributeRule
      attributeID="',$attr{id},'"><PermitValueRule
      xsi:type="ANY"></AttributeRule>', "\n";</tt><tt><br>
    </tt><tt>  }</tt><tt><br>
    </tt><tt>}</tt><br>
    <br>
    <pre class="moz-signature" cols="72">-- 
%%  Christopher A. Bongaarts   %%  <a class="moz-txt-link-abbreviated" href="mailto:cab@umn.edu">cab@umn.edu</a>          %%
%%  OIT - Identity Management  %%  <a class="moz-txt-link-freetext" href="http://umn.edu/~cab">http://umn.edu/~cab</a>  %%
%%  University of Minnesota    %%  +1 (612) 625-1809    %%
</pre>
  </body>
</html>