MCPcopy Create free account
hub / github.com/crewjam/saml / Element

Method Element

schema.go:1082–1096  ·  view source on GitHub ↗

Element returns an etree.Element representing the object in XML form.

()

Source from the content-addressed store, hash-verified

1080
1081// Element returns an etree.Element representing the object in XML form.
1082func (a *AuthnStatement) Element() *etree.Element {
1083 el := etree.NewElement("saml:AuthnStatement")
1084 el.CreateAttr("AuthnInstant", a.AuthnInstant.Format(timeFormat))
1085 if a.SessionIndex != "" {
1086 el.CreateAttr("SessionIndex", a.SessionIndex)
1087 }
1088 if a.SessionNotOnOrAfter != nil {
1089 el.CreateAttr("SessionNotOnOrAfter", a.SessionNotOnOrAfter.Format(timeFormat))
1090 }
1091 if a.SubjectLocality != nil {
1092 el.AddChild(a.SubjectLocality.Element())
1093 }
1094 el.AddChild(a.AuthnContext.Element())
1095 return el
1096}
1097
1098// MarshalXML implements xml.Marshaler
1099func (a *AuthnStatement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {

Calls 1

ElementMethod · 0.45