![]() |
|
#1
|
|||
|
|||
|
I need some help on prasing or embedding XML into an HTML document...
for example... if my XML document is the following: [code:sycqau0o7n]<?xml version="1.0" encoding="iso-8859-1"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <channel> <title><$MTBlogName remove_html="1" encode_xml="1"$></title> <link><$MTBlogURL$></link> <description><$MTBlogDescription remove_html="1" encode_xml="1"$></description> <dc:language>en-us</dc:language> <dc:creator><MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries></dc:creator> <dc:rights>Copyright <$MTDate format="%Y"></dc:rights> <dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></MTEntries></dc:date> <admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" /> <admin:errorReportsTo rdf:resource="mailto:<MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries>"/> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> <MTGlobalEntries include_blogs="1,9,8" lastn="15"> <item> <title><$MTEntryTitle remove_html="1" encode_xml="1"$></title> <link><$MTEntryLink encode_xml="1"$></link> <guid isPermaLink="false"><$MTEntryID$>@<$MTBlogURL$></guid> <content:encoded><![CDATA[<$MTEntryBody$>]]></content:encoded> <dc:subject><$MTEntryCategory remove_html="1" encode_xml="1"$></dc:subject> <dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date> </item> </MTGlobalEntries> </channel> </rss>[/code:sycqau0o7n] I tried something like this... [code:sycqau0o7n] <xml id="blogs" src="index.xml"></xml> <table width="150" border="0" cellspacing="0" cellpadding="0" datasrc="#blogs"> <tr> <td width="10" valign="top" class="col1title">*#8226; </td> <td width="140" valign="top"><span datafld="description"></span> </td> </tr> </table>[/code:sycqau0o7n] But, it displays nothing! Thanks.. |
|
#2
|
|||
|
|||
|
IE:
inhoud=new ActiveXObject("Microsoft.XMLDOM"); inhoud.async="false"; inhoud.load("index.xml"); Moz: inhoud = document.implementation.createDocument("", "", null); inhoud.addEventListener("load", documentLoaded, false); //not needed. (goto function documentLoaded) inhoud.load("index.xml"); and can use it like: var x = inhoud.getElementByTagNam("tagname")[0]; var y = x.getElementByTagName("subitem")[0].firstchild.data; (in xml like: <tagname><subitem>information</subitem></tagname>) if you would use a attribute: x.getAttribute("subject"); (in XML like: <tagname subject="something"/>) set it to HTML: var z = document.getElementById("element"); z.innerHTML = y; (in HTML like: <div id="element"></div>) #[P2R:XML] Do i valid? Since: 1982 |
|
#3
|
|||
|
|||
|
Syedur, why would you want to include your RSS feed into a normal HTML page?
- [url="http://neo.dzygn.com/"]Mark[/url:dhr3kr58vk] |
|
#4
|
|||
|
|||
|
Yeah this is one use for the HTML link tag right?
[code:anjmdthnin]<link rel="alternate" type="application/rss+xml" title="RSS" href="lala.rss">[/code:anjmdthnin] Of course you could do it properly using XML, XHTML and this using namespaces but the massive majority of browsers wouldn't support it (i.e. application+xml). -- Regards, Tim Scarfe <tim@developer-x.com> http://www.developer-x.com |
|
#5
|
|||
|
|||
|
<blockquote id="quote"><span class="smalltext" id="quote">quote:<hr id="quote">Of course you could do it properly using XML, XHTML and this using namespaces but the massive majority of browsers wouldn't support it (i.e. application+xml).<hr id="quote"></blockquote id="quote"></span id="quote">
Actually, the majority of new browsers support this. Yes, this excludes IE6. - [url="http://neo.dzygn.com/"]Mark[/url:buir87yw89] |
|
#6
|
|||
|
|||
|
<blockquote id="quote"><span class="smalltext" id="quote">quote:<hr id="quote">Originally posted by Mark
Syedur, why would you want to include your RSS feed into a normal HTML page? - [url="http://neo.dzygn.com/"]Mark[/url:bkq3mauriq] <hr id="quote"></blockquote id="quote"></span id="quote"> I am trying to tie in some blogs together and have one page to display that information. The thing is, it can be done easily with MT Scripts and without any rss feed. But, the page I am going to create is not going to be generated via MT. Therefore, I am generation global XML files via MT and then having those data display in the HTML/PHP page. |
|
#7
|
|||
|
|||
|
<blockquote id="quote"><span class="smalltext" id="quote">quote:<hr id="quote">
Actually[??-ed], the majority of new browsers support this. Yes, this excludes IE6. <hr id="quote"></blockquote id="quote"></span id="quote"> Irrelevant. Read what I said: <blockquote id="quote"><span class="smalltext" id="quote">quote:<hr id="quote">Of course you could do it properly using XML, XHTML and this using namespaces but the massive majority of browsers wouldn't support it (i.e. application+xml).<hr id="quote"></blockquote id="quote"></span id="quote"> WinIE5 and WinIE6 represent something like 95% of browsers being used today. -- Regards, Tim Scarfe <tim@developer-x.com> http://www.developer-x.com |
|
#8
|
|||
|
|||
|
Opera don't support XML.
but Moz support XML perfect. and IE support XML on Microsoft own way with ActiveX. And because IE don't support application+xml, you can better made a text/html page, and load xml, and don't made the complete page true XML based. Use XML just for information handling, and don't use for styling. I don't know how it works with rss, and i don't know where it is for. #[P2R:XML] Do i valid? Since: 1982 |
|
#9
|
|||
|
|||
|
No. Not a good idea to send XHTML in text/html.
http://www.hixie.ch/advocacy/xhtml -- Regards, Tim Scarfe <tim@developer-x.com> http://www.developer-x.com |
|
#10
|
|||
|
|||
|
Tim: browsers are a different thing than browser usage. But it is, as you said, irrelevant
![]() Pewprod: Opera7 supports XML, but not JavaScript inside a XML document. Read more on RSS: http://www.matthom.com/archive/2003/11/05/01/ - [url="http://neo.dzygn.com/"]Mark[/url:6t1iof0eco] |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|