Windows.Data.Xml.Dom.XmlElement.GetElementsByTagName C# (CSharp) Method

GetElementsByTagName() public method

public GetElementsByTagName ( [ tagName ) : XmlNodeList
tagName [
return XmlNodeList
		public extern XmlNodeList GetElementsByTagName([In] string tagName);
		public extern void SetAttributeNS([Variant] [In] object namespaceUri, [In] string qualifiedName, [In] string value);

Usage Example

Example #1
0
        private void ParseMPDElement()
        {
            Windows.Data.Xml.Dom.XmlElement root = document.DocumentElement;
            if (root.GetAttribute("type").ToLower().Equals("dynamic"))
            {
                manifest.IsLive = true;
            }
            if (root.GetAttribute("profiles").ToLower().Contains(LiveProfile))
            {
                manifest.IsSupportedProfile = true;
            }
            if (!root.GetAttribute("availabilityStartTime").Equals(""))
            {
                string availabilityStartTime = root.GetAttribute("availabilityStartTime");
                manifest.AvailibilityStartTime = XmlConvert.ToDateTimeOffset(availabilityStartTime);
            }
            if (!root.GetAttribute("minBufferTime").Equals(""))
            {
                string minBufferTime = root.GetAttribute("minBufferTime");
                manifest.MinBufferTime = XmlConvert.ToTimeSpan(minBufferTime);
            }
            if (!root.GetAttribute("minimumUpdatePeriod").Equals(""))
            {
                manifest.HasMinimumUpdatePeriod = true;
                string minUpdatePeriod = root.GetAttribute("minimumUpdatePeriod");
                manifest.MinimumUpdatePeriod = XmlConvert.ToTimeSpan(minUpdatePeriod);
            }
            if (!root.GetAttribute("mediaPresentationDuration").Equals(""))
            {
                manifest.HasPresentationDuration = true;
                string mediaPresentationDuration = root.GetAttribute("mediaPresentationDuration");
                manifest.MediaPresentationDuration = XmlConvert.ToTimeSpan(mediaPresentationDuration);
            }
            if (!root.GetAttribute("timeShiftBufferDepth").Equals(""))
            {
                string timeShiftBufferDepth = root.GetAttribute("timeShiftBufferDepth");
                manifest.TimeShiftBufferDepth = XmlConvert.ToTimeSpan(timeShiftBufferDepth);
            }
            if (!root.GetAttribute("publishTime").Equals(""))
            {
                string publishTime = root.GetAttribute("publishTime");
                manifest.PublishTime = XmlConvert.ToDateTimeOffset(publishTime);
            }
            else
            {
                manifest.PublishTime = DateTimeOffset.MinValue;
            }
            Windows.Data.Xml.Dom.XmlNodeList periods = root.GetElementsByTagName("Period");
            if (periods.Count() > 1)
            {
                manifest.HasMultiplePeriods = true;
            }

            IXmlNode lastPeriod = periods.Last <IXmlNode>();

            if (lastPeriod.Attributes.GetNamedItem("duration") != null)
            {
                manifest.LastPeriodDuration = XmlConvert.ToTimeSpan(lastPeriod.Attributes.GetNamedItem("duration").InnerText);
            }
        }
All Usage Examples Of Windows.Data.Xml.Dom.XmlElement::GetElementsByTagName