Skip to content

Commit

Permalink
Merge pull request #12 from Comcast/explicit-xsi-namespaces
Browse files Browse the repository at this point in the history
adding explicit namespace prefixes for content and title xsi types
  • Loading branch information
tjjwilson authored Jan 6, 2021
2 parents 6e63cff + 2413d09 commit 0172fed
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions types/scte224v20180501/adi30/adi30.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,37 @@ type ADI30 struct {
Xsi string `xml:"http://www.w3.org/2001/XMLSchema-instance xsi,attr" json:"-"`
//Xmlns string `xml:"xmlns,attr" json:"-"`
*/
ContentNamespace ContentXSIPrefix `xml:"explicitContentNamespace,attr"`
TitleNamespace TitleXSIPrefix `xml:"explicitTitleNamespace,attr"`
Asset []*Asset `xml:"Asset,omitempty" json:"asset,omitempty"`
//Metadata *Metadata `xml:"Metadata"`
}


type TitleXSIPrefix struct{}

func (t TitleXSIPrefix) MarshalXMLAttr(name xml.Name) (xml.Attr, error) {
return xml.Attr{
Name: xml.Name{
Space: "",
Local: "xmlns:title",
},
Value: "http://www.scte.org/schemas/236/2017/title",
}, nil
}

type ContentXSIPrefix struct {}

func (c ContentXSIPrefix) MarshalXMLAttr(name xml.Name) (xml.Attr, error) {
return xml.Attr{
Name: xml.Name{
Space: "",
Local: "xmlns:content",
},
Value: "http://www.scte.org/schemas/236/2017/content",
}, nil
}

// Metadata elements are containers for a single AMS element and
// zero or more App_Data elements.
type Metadata struct {
Expand Down
2 changes: 1 addition & 1 deletion types/scte224v20180501/roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const expectedInlinedADIMetadata = `<Media xmlns="http://www.scte.org/schemas/22
<MediaPoint xmlns="http://www.scte.org/schemas/224" id="hbo.com/media/HBOHD/program/f2MhzKZcfiosBNjDM2hHGK0F8_Jv5fUR/start" description="The Plot Against America" lastUpdated="2020-03-31T18:00:20.5Z" effective="2020-03-31T00:55:00Z" expires="2020-03-31T01:05:00Z" matchTime="2020-03-31T01:00:00Z" source="HBOHD" order="0">
<AltID xmlns="http://www.scte.org/schemas/224">ow7qaht5qULfWFcl5sbvzJXOVJEHsP6a</AltID>
<Metadata xmlns="http://www.scte.org/schemas/224">
<ADI3 xmlns="http://www.scte.org/schemas/236/2017/core">
<ADI3 xmlns="http://www.scte.org/schemas/236/2017/core" xmlns:content="http://www.scte.org/schemas/236/2017/content" xmlns:title="http://www.scte.org/schemas/236/2017/title">
<Asset xmlns:XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance:type="content:MovieType" uriId="" providerVersionNum="20" internalVersionNum="20" creationDateTime="2020-03-30T00:00:00" startDateTime="2020-03-30T18:00:00.000-07:00" endDateTime="2020-03-30T19:01:00.000-07:00" lastModifiedDateTime="2020-03-24T23:21:02.000-07:00">
<Provider>HBO</Provider>
<Language xmlns="http://www.scte.org/schemas/236/2017/content" bitStreamMode="2">eng</Language>
Expand Down

0 comments on commit 0172fed

Please sign in to comment.