I’m loading in a smil file (follows the xml format) and it won’t let me select properties via name (eg. xml.body) instead I can only access the data by xml.child(0).
I’ve tried xml.child('body'), but still nothing. Anyone know a quick workaround? I would like to be able to access xml.head.(@name=='rtmpPlaybackbase') and the XMLList xml.body.switch.video
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<head>
<meta name="title" content="myStream"/>
<meta name="httpBase" content="http://mydomain.com/"/>
<meta name="rtmpPlaybackBase" content="http://mydomain.com/"/>
</head>
<body>
<switch>
<video src="myStream500K@54552" system-bitrate="500000"/>
<video src="myStream900K@54552" system-bitrate="900000"/>
<video src="myStream1500K@54552" system-bitrate="1500000"/>
</switch>
</body>
Many Thanks!
First of all, close your start tag , in the end with . Let’s say you have it now like this:
Then if you trace the length of xml.body, it gives 0.
This is mainly because you have to use xml namespace:
Now use this namespace to reach your tags in the xml:
So
xml.ns::TAGNAMEis how you reach it.Hope this helps.