Element returns an etree.Element representing the object in XML form.
()
| 896 | |
| 897 | // Element returns an etree.Element representing the object in XML form. |
| 898 | func (s *SubjectConfirmationData) Element() *etree.Element { |
| 899 | el := etree.NewElement("saml:SubjectConfirmationData") |
| 900 | if !s.NotBefore.IsZero() { |
| 901 | el.CreateAttr("NotBefore", s.NotBefore.Format(timeFormat)) |
| 902 | } |
| 903 | if !s.NotOnOrAfter.IsZero() { |
| 904 | el.CreateAttr("NotOnOrAfter", s.NotOnOrAfter.Format(timeFormat)) |
| 905 | } |
| 906 | if s.Recipient != "" { |
| 907 | el.CreateAttr("Recipient", s.Recipient) |
| 908 | } |
| 909 | if s.InResponseTo != "" { |
| 910 | el.CreateAttr("InResponseTo", s.InResponseTo) |
| 911 | } |
| 912 | if s.Address != "" { |
| 913 | el.CreateAttr("Address", s.Address) |
| 914 | } |
| 915 | return el |
| 916 | } |
| 917 | |
| 918 | // MarshalXML implements xml.Marshaler |
| 919 | func (s *SubjectConfirmationData) MarshalXML(e *xml.Encoder, start xml.StartElement) error { |
nothing calls this directly
no outgoing calls
no test coverage detected