DHTML Forum  

Go Back   DHTML Forum > dhtmlcentral.com > Off-topic
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06.02.2004, 05:50
Syedur Syedur is offline
Erfahrener Benutzer
 
Join Date: 12.05.2001
Location: USA
Posts: 347
Default

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..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 06.02.2004, 09:32
pewprod pewprod is offline
Benutzer
 
Join Date: 02.06.2003
Location: Netherlands
Posts: 68
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 06.02.2004, 14:10
Mark Mark is offline
Erfahrener Benutzer
 
Join Date: 28.02.2002
Location: Netherlands
Posts: 2.853
Default

Syedur, why would you want to include your RSS feed into a normal HTML page?

- [url="http://neo.dzygn.com/"]Mark[/url:dhr3kr58vk]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 06.02.2004, 16:15
Tim Scarfe Tim Scarfe is offline
Erfahrener Benutzer
 
Join Date: 14.05.2001
Location: United Kingdom
Posts: 1.015
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 06.02.2004, 16:49
Mark Mark is offline
Erfahrener Benutzer
 
Join Date: 28.02.2002
Location: Netherlands
Posts: 2.853
Default

<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]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 06.02.2004, 21:58
Syedur Syedur is offline
Erfahrener Benutzer
 
Join Date: 12.05.2001
Location: USA
Posts: 347
Default

<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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 06.02.2004, 23:47
Tim Scarfe Tim Scarfe is offline
Erfahrener Benutzer
 
Join Date: 14.05.2001
Location: United Kingdom
Posts: 1.015
Default

<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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 07.02.2004, 00:22
pewprod pewprod is offline
Benutzer
 
Join Date: 02.06.2003
Location: Netherlands
Posts: 68
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 07.02.2004, 11:31
Tim Scarfe Tim Scarfe is offline
Erfahrener Benutzer
 
Join Date: 14.05.2001
Location: United Kingdom
Posts: 1.015
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 07.02.2004, 14:04
Mark Mark is offline
Erfahrener Benutzer
 
Join Date: 28.02.2002
Location: Netherlands
Posts: 2.853
Default

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]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT +2. The time now is 03:48.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.