Hi,

I've been scratching my head trying to figure out why the following code
fragment generates 8 attributes even though only 7 are set.  The extra
attribute is 'xmlns=""'.

...
public final static String XML_NS = "http://www.w3.org/XML/1998/namespace";;
public final static String XMLNS_NS = "http://www.w3.org/2000/xmlns/";;
public final static String SAMLP_NS =
"urn:oasis:names:tc:SAML:1.0:protocol";
public final static String SAML_NS =
"urn:oasis:names:tc:SAML:1.0:assertion";
public final static String XMLSIG_NS = "http://www.w3.org/2000/09/xmldsig#";;
...
Element r = doc.createElementNS(XML.SAMLP_NS, "samlp:Request");
r.setAttributeNS(XMLNS_NS, "xmlns:samlp", XML.SAMLP_NS);
r.setAttributeNS(XMLNS_NS, "xmlns:saml", XML.SAML_NS);
r.setAttributeNS(XMLNS_NS, "xmlns:ds", XML.XMLSIG_NS);
r.setAttributeNS(null, "MajorVersion", "1");
r.setAttributeNS(null, "MinorVersion", "0");
r.setAttributeNS(null, "RequestID", requestId);
SimpleDateFormat formatter = new
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");

formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
r.setAttributeNS(null, "IssueInstant", formatter.format(issueInstant));
...

I've been using xerces 2.0.1 but I tried the latest jars (2.4.0) and I
get the same behavior.

Can someone help?

TIA,
David
--
Obligatory .signatory
David Warren       phone: 781-515-7152
RSA Security Inc., 174 Middlesex Turnpike, Bedford, MA 01730
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to