Element returns an etree.Element representing the object in XML form.
()
| 1461 | |
| 1462 | // Element returns an etree.Element representing the object in XML form. |
| 1463 | func (s *SubjectConfirmationData) Element() *etree.Element { |
| 1464 | el := etree.NewElement("saml:SubjectConfirmationData") |
| 1465 | if !s.NotBefore.IsZero() { |
| 1466 | el.CreateAttr("NotBefore", formatTime(s.NotBefore)) |
| 1467 | } |
| 1468 | if !s.NotOnOrAfter.IsZero() { |
| 1469 | el.CreateAttr("NotOnOrAfter", formatTime(s.NotOnOrAfter)) |
| 1470 | } |
| 1471 | if s.Recipient != "" { |
| 1472 | el.CreateAttr("Recipient", s.Recipient) |
| 1473 | } |
| 1474 | if s.InResponseTo != "" { |
| 1475 | el.CreateAttr("InResponseTo", s.InResponseTo) |
| 1476 | } |
| 1477 | if s.Address != "" { |
| 1478 | el.CreateAttr("Address", s.Address) |
| 1479 | } |
| 1480 | return el |
| 1481 | } |
| 1482 | |
| 1483 | // MarshalXML implements xml.Marshaler |
| 1484 | func (s SubjectConfirmationData) MarshalXML(e *xml.Encoder, start xml.StartElement) error { |
nothing calls this directly
no test coverage detected