Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. boen_robot

    RSS feeds

    Well, you may use PHP or other server side scripting language to translate the data. Here's a sample PHP parser I found on a site: class RSS_Parser{// {{{ part-variables (all private)var $Counter; // counts each resource of informationvar $Current; // contains the name of the current elementvar $Parent; // contains the name of the parent of the current elementvar $Parser; // the XML parservar $Result; // the array containg all neccesary information// }}} // {{{ constructor/**Prepares the object*@access public*/function RSS_Parser(){$this->Counter = 0;$this->Current = '';$this->Parent = '';if(!($this->Parser = xml_parser_create()))die('Could not create XML parser!');xml_set_element_handler($this->Parser, 'start', 'end');xml_set_character_data_handler($this->Parser, 'data');}// }}} // {{{ start()/**Controls the opening tags*@access private@param resource $Parser XML parser@param string $Element name of the element@param array $Att array containg the attributes of the element*/function start($Parser, $Element, $Att){if(ereg(':', $Element))list($prefix, $this->Current) = explode(':', $Element);else$this->Current = $Element;if(($this->Current == 'CHANNEL') || ($this->Current == 'IMAGE') || ($this->Current == 'ITEM'))$this->Parent = $this->Current;if($this->Current == 'ITEM')$this->Counter++;}// }}} // {{{ end()/**Controls the closing tags*@access private@param resource $Parser XML parser@param string $Element name of the element*/function end($Parser, $Element){$this->Current = '';}// }}} // {{{ data()/**Controls the data*@access private@param resource $Parser XML parser@param string $Data simbolic data of the element*/function data($Parser, $Data){if(($this->Current == '') || (trim($Data) == ''))return;if($this->Parent == 'ITEM')$this->Result['items'][$this->Counter][strtolower($this->Current)] .= stripslashes(htmlspecialchars($Data, ENT_NOQUOTES));if(($this->Parent == 'CHANNEL') || ($this->Parent == 'IMAGE'))$this->Result[strtolower($this->Parent)][strtolower($this->Current)] .= stripslashes(htmlspecialchars($Data, ENT_NOQUOTES));}// }}} // {{{ parse()/**Parses the current document*@access public@param string $file name of the file or URL@return array Array containg the neccesary info*/function parse($file){$this->Result = array();$fp = @fopen($file, 'r');xml_set_object($this->Parser, &$this);while($Data = fread($fp, 4096)){if(!xml_parse($this->Parser, $Data, feof($fp)))break;}xml_parser_free($this->Parser);$this->RSS_Parser();return $this->Result;}// }}}} The page wich would include the feed must include this: <?php// Include the parserinclude('parser.php');$p = new RSS_Parser();// The array containg the information from the feed$channel = array();$channel = $p->parse(news.rss');// Visualize the name of the site...echo '<b><a href="'.$channel['channel']['link'].'" ';echo 'target="_blank" ';echo 'title="'.$channel['channel']['description'].'">';echo $channel['channel']['title'].'</a></b><br />';// ... as well as the individual names of every newsforeach($channel['items'] as $item){echo ' » <a href="'.$item['link'].'" target="_blank" title="'.$item['description'].'">'.$item['title'].'</a><br />';}?> Notice that this code is made from a Bulgarian and that I have (atleast tryed to) translate all the comments inside. I have not tested the code, so I don't know if it will work at all.Also notice that you must change "news.rss" to the actual name of your feed.
  2. Thank you for not giving any reply on my question(that's sarcasm).I somehow managed to solve my issue. It's something that for some reason is ot mentioned in the XSLT referance nor Dreamwaver's:An include element can't exist inside a template. It could be before a template, after a template, and between two templates but never inside a template.I also discovered something really odd for the template<->include relationships which I would like someone to explain me in detail please... If you place include element BEFORE a template, the template will be executed but not the include element. If you place the include element AFTER the template you'll get the opposite effect- the template is not executed but the include element is.The "output" element from the main XSLT had to be removed as well. OK. I have an absolutely clean code. But here comes the weirdest part of it all.When I include more that one file one after another, only the latest one is displayed. Why?Here are the new versions of the codes:test.xsl <?xml version="1.0" encoding="windows-1251"?><!-- DWXMLSource="test.xml" --><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:include href="links.xsl" /><xsl:include href="image.xsl" /></xsl:stylesheet> links.xsl <?xml version="1.0" encoding="windows-1251"?><!-- DWXMLSource="test.xml" --><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="windows-1251"/><xsl:template match="/"><xsl:for-each select="/site/links/menu/item"><xsl:variable name="link" select="link" /><xsl:variable name="logo" select="logo" /><xsl:variable name="title" select="title" /><a href="{$link}"><img src="{$logo}" alt="{$title}" /></a><br /></xsl:for-each></xsl:template></xsl:stylesheet> image.xsl <?xml version="1.0" encoding="windows-1251"?><!-- DWXMLSource="test.xml" --><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="windows-1251"/><xsl:template match="/"><xsl:for-each select="/site/images/image"><xsl:variable name="location" select="location" /><xsl:variable name="description" select="description" /><img src="{$location}" alt="{$description}" /><br /></xsl:for-each></xsl:template></xsl:stylesheet> Any ideas why is it like that and what should I do to include more than one file in a single document?
  3. No. This message means that the data is not encrypted... that is... not encoded. In other words- If the site's administrator decides that he would like to view your data, he can do it. BEWARE! This MAY also includes passwords. Anyway- this doesn't always mean that the admin is a froad. If you trust the site and the admin(s) there's no reason why not to post your data.
  4. Well, at first I must say it's like you have some errors in your code. I kind of solved your problem, but the solution I found makes some other rather weird errors. Previewing the XML in IE resulted in placing a "B" instead of a space. In FireFox however, everything was fine. It's kind of odd, scince IE is known to have a full XML support.The partial solution to your problem was a DTD in which the entities(and in the process: all other elements) are specified.instrument_table.xml <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE Instruments [ <!ELEMENT Instruments ANY> <!ELEMENT changed ANY> <!ELEMENT ID_BB_UNIQUE ANY> <!ELEMENT ID_SEDOL1 ANY> <!ELEMENT ID_SEDOL2 ANY> <!ELEMENT ID_SEDOL3 ANY> <!ELEMENT TICKER ANY> <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]><?xml-stylesheet type="text/xsl" href="instrument_table.xsl" ?><Instruments><changed><ID_BB_UNIQUE>ABCDEFG</ID_BB_UNIQUE><ID_SEDOL1>S02548</ID_SEDOL1><ID_SEDOL2> </ID_SEDOL2><ID_SEDOL3> </ID_SEDOL3><TICKER>BA</TICKER></changed><changed><ID_BB_UNIQUE>PQRSTUV</ID_BB_UNIQUE><ID_SEDOL1>B0JYD4</ID_SEDOL1><ID_SEDOL2>B095JTY</ID_SEDOL2><ID_SEDOL3> </ID_SEDOL3><TICKER>BA</TICKER></changed></Instruments> instrument_table.xsl <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [ <!ELEMENT Instruments ANY> <!ELEMENT changed ANY> <!ELEMENT ID_BB_UNIQUE ANY> <!ELEMENT ID_SEDOL1 ANY> <!ELEMENT ID_SEDOL2 ANY> <!ELEMENT ID_SEDOL3 ANY> <!ELEMENT TICKER ANY> <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/><xsl:template match="/Instruments"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Instrument changes</title></head><body><font face="arial"><table><tr><td><p>Instrument List</p></td></tr><tr><td><table border='1' cellpadding='5' align='Left'><tr bgcolor="#cccccc"><th>BLOOMBERG ID</th><th>SEDOL1</th><th>SEDOL2</th><th>SEDOL3</th><th>TICKER</th></tr><xsl:for-each select="changed"><tr><td><xsl:value-of select="ID_BB_UNIQUE"/></td><td><xsl:value-of select="ID_SEDOL1"/></td><td><xsl:value-of select="ID_SEDOL2"/></td><td><xsl:value-of select="ID_SEDOL3"/></td><td><xsl:value-of select="TICKER"/></td></tr></xsl:for-each></table></td></tr></table></font></body></html></xsl:template></xsl:stylesheet>
  5. Maybe it really doesn't support the title attribute. Try using "alt" instead. I mean... what's the difference between a tooltip(the "title") and the "alt" attribute? If the image is present and you hold over the image, it will display the alt text in a tooltip...I guess you would be able to "live" without a specific text for the tooltip, right? Your visitors as well... This isn't something you should worry about.
  6. Well "stupid"(I don't think you are, but if you insist...) SVG stands for Scalable Vector Graphics. It's a XML based alternative to Flash(well... kind of). In other words, it's a programming language with an XML syntax that displays inteactive information on the screen. Because it's based on XML, it could be syncronized with an XML that would carry the data. That way, maintaining the data up to date becomes much easier.For more information see the SVG tutorial on w3schools
  7. I've recently started experimenting with XSLT and some it's more... complicated elements. The <xsl:include> element is kind of causing trouble. The combined XSLT is well formated according to Dreamwaver 8. I know it's syntax after all, but I don't know how the fragment file must look like. Could someone please give me an example of how the fragment file must look like. Here's what I currently have:test.xml - the source <?xml version="1.0" encoding="windows-1251"?><?xml-stylesheet type="text/xsl" href="test.xsl"?><site> <images> <image> <location>http://www.w3schools.com/images/pic_keybmouse_2.jpg</location> <description>Mouse</description> </image> <image> <location>http://www.w3schools.com/images/pic_keyb_2.jpg</location> <description>Keyboard</description> </image> </images> <links> <menu> <item> <link>http://www.w3schools.com</link> <title>w3schools</title> <logo>http://www.w3schools.com/images/logo_new2.jpg</logo> </item> <item> <link>http://www.microsoft.com/</link> <title>Microsoft</title> <logo>http://i.microsoft.com/h/all/i/ms_masthead_10x7a_ltr.jpg</logo> </item> </menu> </links></site> test.xsl - The main XSLT. <?xml version="1.0" encoding="windows-1251"?><!-- DWXMLSource="test.xml" --><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="windows-1251" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /><xsl:template match="/"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /><title>test</title><link rel="stylesheet" type="text/css" href="test.css" /></head><body><xsl:include href="image.xsl" /><xsl:for-each select="/site/links/menu/item"><xsl:variable name="link" select="link" /><xsl:variable name="logo" select="logo" /><xsl:variable name="title" select="title" /><a href="{$link}"><img src="{$logo}" alt="{$title}" /></a><br /></xsl:for-each></body></html></xsl:template></xsl:stylesheet> image.xsl - The fragment XSLT that is included in the main one. <?xml version="1.0" encoding="windows-1251"?><!-- DWXMLSource="test.xml" --><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="windows-1251" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /><xsl:template match="/"><xsl:for-each select="/site/images/image"><xsl:variable name="location" select="location" /><xsl:variable name="description" select="description" /><img src="{$location}" alt="{$description}" /><br /></xsl:for-each></xsl:template></xsl:stylesheet> The fragment template works when it's directly in the main XSLT but not when it's on another file. A code which works is this one: <?xml version="1.0" encoding="windows-1251"?><!-- DWXMLSource="test.xml" --><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="windows-1251" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /><xsl:template match="/"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /><title>test</title><link rel="stylesheet" type="text/css" href="test.css" /></head><body><xsl:for-each select="/site/images/image"><xsl:variable name="location" select="location" /><xsl:variable name="description" select="description" /><img src="{$location}" alt="{$description}" /><br /></xsl:for-each><xsl:for-each select="/site/links/menu/item"><xsl:variable name="link" select="link" /><xsl:variable name="logo" select="logo" /><xsl:variable name="title" select="title" /><a href="{$link}"><img src="{$logo}" alt="{$title}" /></a><br /></xsl:for-each></body></html></xsl:template></xsl:stylesheet> Could someone please tell me what I'm doing wrong and how should the fragment file look.
  8. Well... actually the latest version of Dreamwaver is 8, not MX. Here's more info:http://www.macromedia.com/software/dreamweaver/
  9. In order to be more convinient for all of us, I suggest we use a template of questions that everyone posting here should answer. Here is the template: I use a simmilar one in my own forum . Notice that "Alternative name(s)" doesn't mean a Nickname you would use in forums, but how they call you in the "real world". So here is my presentation...Full name: Vasil Dimitrov RangelovAlternative name(s): VaskoBirth date(dd/mm/yyyy): 03/09/1989Gender: MaleZodiacal sign: VirgoCountry of residance: BulgariaCity of residence: PlovdivHeight: 1.72mWeight: ~above the normal~Eyes: BlueHair: BlackSmoking/Drinking/Drugs: No/No/NoFavourite Music: Almost everything excluding Hard Rock.Favourite Movies: Comedies.Interest: Everything about computers. When it comes to web design I think I'm most interested in XML and related technologies.Pets: None.Additional comments: I have vey big plans for my future, most of witch are really... impossible. In some way I think w3schools will let me be closer to my dreams though.[edit]@Chocolate570 well of course you fill the questions you want to answer to. As you have noticed, I haven't said my exact weight [/edit]
  10. I don't think any of you are getting Jonas' point. The idea is to directly show the newbies stuff without the registration thingyes. After all, a person who has recently leared HTML and has no idea what a web host is might get stuck at the point where he has to show someone what he has done.The simplest way to do this would be if the admins allow the DoHTML BBCode in the forum. This allows for a direct imput of pure HTML. The problem is someone might use this to "hack" the forums. A good thing might be if it was able to send such executeable DoHTML BBCodes to a new window which allows only for strict XHTML 1.1 and nothing more .
  11. How come you added a <script> tag at the bottom of the page? I thought this tag is not allowed in strict mode.
  12. True, but here comes our fist issue: The Table menu&data pages consist of at least 2 cells per row(from what I have seen that is). One for the menu, and another for the data. Some have 2 cells and 2 rows... the top left for a logo, the top right for a horizontal menu, the bottom left fot a vertical menu and the bottom right for the content. have So what should one do to recreate two or more cells per row on a table with CSS? I mean... the content must be visible and yet the menu must stand from the side.The way I see it now is still a table with two cells and one row. The left cell holds the menu made with the above example of CSS. The right one holds the data.That's still not what I'm personally looking after thogh it is a temporary solution.
  13. I recently learned that there is a small problem with this when it comes to ForeFox and Opera browsers. To fix this issue you must do:body {text-align: center; margin: auto;} I think it's like this because text-align aligns the content inside an element but not the element itself. Besides... the thing that wasn't aligned is a table...Someone please correct me if I'm wrong and suggest a better solution if any.
  14. I have seen and tryed this. It's certanly the best way to make horizontal menus.But I would like to know how to make vertical ones too. Whatever I do, I can't get the menu on the left(nor right) AND have the main content in the center of the page. Tables are the only solution I had found, but that's certanly not the thing I want to do. CSS is the future. Tables are there only for tabular data.
  15. So in other words, I guess the XSL you need is: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"><xsl:value-of select="data/field/value[@date]" /><xsl:value-of select="data/field/value[@audience]" /><xsl:value-of select="data/field/value[@message]" /></xsl:template></xsl:stylesheet>
  16. There are personal web server packs such as XAMPP for example, which install a lot of things to make your computer a server. One of it's features is MercuryMail- A free application that can turn your computer(s) into mail server(s). However, the program has a really awful inteface if you ask me. Anyway. That's the thing you need for the server.To make the site needed to browse the mail, allow registration of users, etc. (as mentioned above) you would need to know quite a few languages. At least one of them must be a server side scripting language, so it can manipulate the database which MercuryMail (or any other program for this sort of task) uses.If you can become a master with all modern languages, than maintaing the server will not be that cost effective(unless you introduce it to a large amount of users... then you would need to buy few powerful computers to store and use the data).
  17. I think it's the second one... Any forum could be sleepy at times you know . As for the examples. I wasn't able to see them either. There is some kind of mistake in the ASP code that w3schools has made in order to ensure that you have the adobe plug-in. To avoid this problem simply rename "the-example-file's-name.asp" to "the-example-file's-name.svg". It's an annoying thing to do, but if you want to study SVG, that's the only way for now.
  18. px means PiXels as you mentioned. A pixel is a dot on a screen as you probably know.pt means PoinTs. But a point doesn't mean a dot on a screen. It's a specific quantity for a text measurement. 1pt means that the text is as large as one point(dot) on a paper. On a screen however this could be 2, 3 or more pixels, depending on the screen resolution.I tryed using pt on all of my font sizes and it didn't work. The text was with correct sizes on all browsers but still- the View>Text Size option is not overriden.By the way. Why do you want to override this option? It's always a good thing to allow visitors to change the text size. After all- some of them might have a poor sight .
  19. I think the hover Pseudo-class works only on Anchors(<a> tags) and it doesn't work with any other elements. I tried using it on a span and an anchor and it worked only with the anchor.
  20. What exactly is the code you used? You probably have some mistake or a missing thing somewhere but I don't think anyone(especially I) would be able to assist you without you providing that code.I have wanted to make such a menu myself, so any suggestions would come in handy .
  21. Can someone tell me why is the above page isolated and it's not visible in the CSS tutorial? What other "easter eggs" are there in this site?!?!
  22. Try looking for the admins of this forum and give them a PM message regarding this.By the way... I was thinking of making simmilar thing in bulgarian. However, unlike yourself, I cannot afford a *.bg domain. No.. it's not that much expensive, it's just the overall fact that it needs investment .
  23. boen_robot

    PHP

    I don't know about you but I test my PHPs on a free web host that offers PHP. As most of you would guess, this host has many restrictions, so it's not good for a site, but it's good enough for tests. Here are some hosts that offer PHP support for free:http://1asphost.com/http://www.hotsql.comhttp://www.tripod.lycos.co.ukhttp://www.illusionfxnet.comhttp://www.maxhost.ru/http://t35.com/http://www.thefreeserver.com/http://www.oinko.net/freephp/http://www.free-hoster.comAnd the one I use :http://www.100webspace.comThe restrictions theese hosts have is a limited bandwidth, a banner that is displayed on your every page, the fact that you use a subdomain and few other stuff which isn't important...
  24. Well... Actually I checked the code that F-Man suggested and it turned out as a valid CSS. I now realize why does the validator requres such. It's because it presumes you define a new background color that would need a new color for the text inside in order to look good. Or at least that's what I think...Anyway. The code F-Man proveided is the one you need Dirx .
  25. I think you're wrong about the center not being working with tables. I recently used it and it worked. But you have to place the <table> tag as a selector, not a part of the the table itself. If you select a table cell, the center attribute will only align the data in the cell but not the cell itself(I think).I didn't quite catch, what you meant by "what options (Total) that are available in doing this.".Anyway... I'm a newbie with CSS, so whatever you meant, I'll most probably not know it .
×
×
  • Create New...