Commit cab2aad
committed
fix: strip onvif: namespace prefix from XML struct tags for correct unmarshaling
Go's encoding/xml does not match namespace prefixes in struct tags —
it matches full namespace URIs. The tags `xml:"onvif:Encoding"` never
matched camera responses like `<tt:Encoding>H264</tt:Encoding>` where
tt maps to http://www.onvif.org/ver10/schema, causing all response
fields (Encoding, Resolution, BitrateLimit, etc.) to unmarshal as
zero values.
Removing the prefix lets Go match by local name regardless of the
namespace prefix the camera uses (tt:, onvif:, or none).
Fixes: use-go#29
Fixes: use-go#521 parent 67386c9 commit cab2aad
3 files changed
Lines changed: 292 additions & 292 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
256 | | - | |
| 255 | + | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
0 commit comments