douxiuyu2028 2014-05-08 21:58
浏览 185
已采纳

php DOMDocument() - > loadXML()无效

I have this XML automatically produced by GPAC MP4Box.

<?xml version="1.0"?>

<!-- MPD file Generated with GPAC version 0.5.1-DEV-rev5223M  on 2014-05-08T02:46:28Z-->
<MPD 
    xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="dynamic" availabilityStartTime="2014-05-07T22:02:08Z" 
    timeShiftBufferDepth="PT0H0M0.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
    <ProgramInformation 
        moreInformationURL="http://gpac.sourceforge.net">
        <Title>session.mpd generated by GPAC</Title>

    </ProgramInformation>

    <Period id="GENID_DEF" start="PT0H0M0.00S">
        <AdaptationSet segmentAlignment="true" maxWidth="352" 
                       maxHeight="288" maxFrameRate="5" par="352:288">
            <SegmentTemplate timescale="10240" media="stream$Number$.m4s" 
                             startNumber="1" duration="20480" initialization="streaminit.mp4"/>
            <Representation id="1" mimeType="video/mp4" 
                            codecs="avc1.42e014" width="352" height="288" frameRate="5" sar="1:1" startWithSAP="1" bandwidth="192548">
            </Representation>

        </AdaptationSet>
    </Period>
</MPD>

And

$x = new DOMDocument();
$x->loadXML('session.mpd');

Results in:

Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1

Does any one see what is wrong?

  • 写回答

1条回答 默认 最新

  • douhuan4699 2014-05-08 22:45
    关注

    DOMDocument::loadXML expects XML source as an argument, if you are going to use file path, use DOMDocument::load

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题