func (si *SubInfo) validate() error {
	if _, err := NewJid(si.Jid); err != nil {
		return err
	}
	if strings.TrimSpace(si.Node) == "" {
		return errors.New("SubInfo must contain the node AND the subscriber JID in subscription config options requests")
	}
	return nil
}
validate checks if a node and a jid are present in the sub info, and if this jid is valid.
package stanza
import (
	"encoding/xml"
	"errors"
	"strings"
)
type PubSubGeneric struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/pubsub pubsub"`
	Create    *Create    `xml:"create,omitempty"`
	Configure *Configure `xml:"configure,omitempty"`
	Subscribe  *SubInfo    `xml:"subscribe,omitempty"`
	SubOptions *SubOptions `xml:"options,omitempty"`
	Publish        *Publish        `xml:"publish,omitempty"`
	PublishOptions *PublishOptions `xml:"publish-options"`
	Affiliations *Affiliations `xml:"affiliations,omitempty"`
	Default      *Default      `xml:"default,omitempty"`
	Items        *Items        `xml:"items,omitempty"`
	Retract      *Retract      `xml:"retract,omitempty"`
	Subscription *Subscription `xml:"subscription,omitempty"`
	Subscriptions *Subscriptions `xml:"subscriptions,omitempty"`
	Unsubscribe *SubInfo `xml:"unsubscribe,omitempty"`
	ResultSet *ResultSet `xml:"set,omitempty"`
}
func (p *PubSubGeneric) Namespace() string {
	return p.XMLName.Space
}
func (p *PubSubGeneric) GetSet() *ResultSet {
	return p.ResultSet
}
type Affiliations struct {
	List []Affiliation `xml:"affiliation"`
	Node string        `xml:"node,attr,omitempty"`
}
type Affiliation struct {
	AffiliationStatus string `xml:"affiliation"`
	Node              string `xml:"node,attr"`
}
type Create struct {
	Node string `xml:"node,attr,omitempty"`
}
type SubOptions struct {
	SubInfo
	Form *Form `xml:"x"`
}
type Configure struct {
	Form *Form `xml:"x"`
}
type Default struct {
	Node string `xml:"node,attr,omitempty"`
	Type string `xml:"type,attr,omitempty"`
	Form *Form  `xml:"x"`
}
type Subscribe struct {
	XMLName xml.Name `xml:"subscribe"`
	SubInfo
}
type Unsubscribe struct {
	XMLName xml.Name `xml:"unsubscribe"`
	SubInfo
}
type SubInfo struct {
	Node string `xml:"node,attr,omitempty"`
	Jid  string `xml:"jid,attr,omitempty"`
	SubId *string `xml:"subid,attr,omitempty"`
}