<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    On 4/12/12 2:52 PM, Brent Putman wrote:
    <blockquote cite="mid:4F872478.40101@georgetown.edu" type="cite"><br>
      <blockquote type="cite">
        <pre wrap="">It's strange because when I call the setIdAttribute(..) directly
before doc.getElementById() it works. Maybe there are some
modifications done on the DOM tree (copying or some such) so that it
does not remember that "ID" is an id?
</pre>
      </blockquote>
      <pre wrap="">
That would definitely cause it.  I can't think of where or how that
would be happening in OpenSAML itself, but it's possible.  Perhaps it's
a side effect of how you are running this. </pre>
    </blockquote>
    <br>
    <br>
    I did think of one issue that causes the ID-ness to be effectively
    lost, at least it causes Document#getElementById to fail.&nbsp; If the
    Element in question is not in the tree of nodes rooted at the
    document root element (i.e. Document#getDocumentElement()), then
    Document#getElementById won't find it.&nbsp; In other words, if it's
    "orphaned" and isn't a descendent of its owning Document's root
    element, then it's not found via DOM search.<br>
    <br>
    One way this can happen is with Decryption.&nbsp; There's some extensive
    Javadocs in the OpenSAML Decrypter class.&nbsp; See the several
    paragraphs beginning with "
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <span class="pygments-c">In both of these cases the underlying DOM
      Element...":<br>
      <br>
<a class="moz-txt-link-freetext" href="http://svn.shibboleth.net/view/java-xmltooling/branches/REL_1/src/main/java/org/opensaml/xml/encryption/Decrypter.java?view=markup">http://svn.shibboleth.net/view/java-xmltooling/branches/REL_1/src/main/java/org/opensaml/xml/encryption/Decrypter.java?view=markup</a><br>
      <br>
      Whether or not you are doing decryption here (e.g. of the
      Assertion from an EncryptedAssertion in the Response), if for some
      reason your Element isn't a descendent of its owning Document's
      root Element, then that can cause this issue.<br>
      <br>
      Just a thought.<br>
      <br>
      --Brent<br>
      <br>
    </span><br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <br>
  </body>
</html>