From 8b84480e741fe95d0d20ee75b6e84deb9837a8e9 Mon Sep 17 00:00:00 2001 From: naudachu Date: Wed, 21 Jun 2023 17:58:51 +0500 Subject: [PATCH] TestGetFileID is working, but FileID cannot be unmarshaled --- helpers/xml_test.go | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/helpers/xml_test.go b/helpers/xml_test.go index 7efcd37..183ef83 100644 --- a/helpers/xml_test.go +++ b/helpers/xml_test.go @@ -23,18 +23,26 @@ import ( */ +/* +type MultistatusObj struct { + XMLName xml.Name `xml:"multistatus"` + Multistatus struct { + XMLName xml.Name `xml:"response"` + Other string `xml:",innerxml"` + } +}*/ type MultistatusObj struct { XMLName xml.Name `xml:"multistatus"` Multistatus struct { - ResponseObj - } -} - -type ResponseObj struct { - XMLName xml.Name `xml:"response"` - Response struct { - Content string `xml:",chardata"` + XMLName xml.Name `xml:"response"` + Propstat struct { + XMLName xml.Name `xml:"propstat"` + Prop struct { + XMLName xml.Name `xml:"prop"` + Other string `xml:",innerxml"` + } + } } } @@ -49,7 +57,7 @@ func GetFileID(str string) string { if err != nil { fmt.Print(err) } - return multi.Multistatus.Response.Content + return multi.Multistatus.Propstat.Prop.Other } func TestGetFileID(t *testing.T) {