从另一个 xml 文件中指定的 xml 文件以 html 显示 xml 数据
你能帮忙吗? 我有一个以 html 显示的基本 xml 文件。
xml 文件是这样的:
<videoList>
<video>
<pointer>
<type><![CDATA[image]]></type>
<lat><![CDATA[52.1]]></lat>
<long><![CDATA[1.0]]></long>
</pointer>
<speaker>
<firstName><![CDATA[Mr Car Dealer]]></firstName>
<town><![CDATA[]]></town>
<description><![CDATA[Car Dealer]]></description>
<longDescription><![CDATA[A car dealer selling BMW's and Audi's]]></longDescription>
<videoCaption><![CDATA[captions/bmw.xml]]></videoCaption>
<video><![CDATA[video/9ADA1C9.flv]]></video>
<story><![CDATA[]]></story>
<picture><![CDATA[images/bmw.jpg]]></picture>
</speaker>
</video>
除了
标记内的数据外,所有内容都显示良好 - 这链接到另一个 XML 文件,该文件由以下内容组成...
<?xml version="1.0" encoding="utf-8"?>
<tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1" xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling">
<head>
<styling>
<style id="1" tts:textAlign="right"/>
<style id="2" tts:color="transparent"/>
<style id="3" style="2" tts:backgroundColor="white"/>
<style id="4" style="2 3" tts:fontSize="10"/>
</styling>
</head>
<body>
<div xml:lang="en">
<p begin="00:00:00.20" dur="00:00:02.00">My name is Mr Car.</p>
<p begin="00:00:02.30" dur="00:00:03.00">We offer original car parts.</p>
</div>
</body>
</tt>
我正在尝试要做的就是将第二个 xml 文件中的数据与相应的数据一起显示,但没有成功。
在第一个 xml 文件中,大约有 10 个条目,每个条目都链接到
标记中的单独 xml 文件。我已成功在 iFrame 中显示第二个 xml 文件,但无法使用 css 对其进行样式设置。它在 Firefox 中不起作用。
目前,我正在使用 Dreamweaver spry 以 html 形式显示数据。
有人有什么想法吗?
Can you help?
I have a basic xml file displaying in html.
The xml file is like this:
<videoList>
<video>
<pointer>
<type><![CDATA[image]]></type>
<lat><![CDATA[52.1]]></lat>
<long><![CDATA[1.0]]></long>
</pointer>
<speaker>
<firstName><![CDATA[Mr Car Dealer]]></firstName>
<town><![CDATA[]]></town>
<description><![CDATA[Car Dealer]]></description>
<longDescription><![CDATA[A car dealer selling BMW's and Audi's]]></longDescription>
<videoCaption><![CDATA[captions/bmw.xml]]></videoCaption>
<video><![CDATA[video/9ADA1C9.flv]]></video>
<story><![CDATA[]]></story>
<picture><![CDATA[images/bmw.jpg]]></picture>
</speaker>
</video>
All is displaying well except the data within the <videoCaption>
tag - this links to another XML file which is made up of the following...
<?xml version="1.0" encoding="utf-8"?>
<tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1" xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling">
<head>
<styling>
<style id="1" tts:textAlign="right"/>
<style id="2" tts:color="transparent"/>
<style id="3" style="2" tts:backgroundColor="white"/>
<style id="4" style="2 3" tts:fontSize="10"/>
</styling>
</head>
<body>
<div xml:lang="en">
<p begin="00:00:00.20" dur="00:00:02.00">My name is Mr Car.</p>
<p begin="00:00:02.30" dur="00:00:03.00">We offer original car parts.</p>
</div>
</body>
</tt>
What I'm trying to do, with no success, is to display the data from the second xml file along side the corresponding data.
In the first xml file there are about 10 entries, and each one links to a separate xml file in the <videoCaption>
tag. I have managed to display the second xml file within an iFrame, but I'm not able to style it using css. It does not work in Firefox.
At the moment, I'm displaying the data in html by using dreamweaver spry.
Has anyone got any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简而言之,我将通过
xmlhttprequest
获取第二个 XML 文件(假设其位于同一域中),然后将其插入适当位置的DIV
中。这样 CSS 样式仍然可用,但使用 iframe 时情况似乎并非如此。
In a nutshell, I would grab the the 2nd XML file (assume its on same domain) via an
xmlhttprequest
and then insert it into the a appropriately positionedDIV
.That way the CSS styles will still be available to it, which seems is not the case when you use an iframe.