equal
deleted
inserted
replaced
42 } |
42 } |
43 var _ xml.Marshaler = &Stream{} |
43 var _ xml.Marshaler = &Stream{} |
44 |
44 |
45 type StreamError struct { |
45 type StreamError struct { |
46 cond definedCondition |
46 cond definedCondition |
47 text errText |
47 text *errText |
48 } |
48 } |
49 var _ xml.Marshaler = &StreamError{} |
49 var _ xml.Marshaler = &StreamError{} |
50 |
50 |
51 type definedCondition struct { |
51 type definedCondition struct { |
52 // Must always be in namespace nsStreams |
52 // Must always be in namespace nsStreams |
53 XMLName xml.Name |
53 XMLName xml.Name |
54 } |
54 } |
55 |
55 |
56 type errText struct { |
56 type errText struct { |
57 XMLName xml.Name |
|
58 Lang string |
57 Lang string |
59 text string `xml:"chardata"` |
58 text string `xml:"chardata"` |
60 } |
59 } |
61 var _ xml.Marshaler = &errText{} |
60 var _ xml.Marshaler = &errText{} |
62 |
61 |
86 |
85 |
87 func (s *StreamError) MarshalXML() ([]byte, os.Error) { |
86 func (s *StreamError) MarshalXML() ([]byte, os.Error) { |
88 buf := bytes.NewBuffer(nil) |
87 buf := bytes.NewBuffer(nil) |
89 buf.WriteString("<stream:error>") |
88 buf.WriteString("<stream:error>") |
90 xml.Marshal(buf, s.cond) |
89 xml.Marshal(buf, s.cond) |
91 xml.Marshal(buf, s.text) |
90 if s.text != nil { |
|
91 xml.Marshal(buf, s.text) |
|
92 } |
92 buf.WriteString("</stream:error>") |
93 buf.WriteString("</stream:error>") |
93 return buf.Bytes(), nil |
94 return buf.Bytes(), nil |
94 } |
95 } |
95 |
96 |
96 func (e *errText) MarshalXML() ([]byte, os.Error) { |
97 func (e *errText) MarshalXML() ([]byte, os.Error) { |