Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. As far as I know, this whole part of the forum is for Suggestions about W3Schools. If you have some kind of "upgrade" for W3Schools or something, you could always present it at least.If you mean an article... well.. W3Schools is about learning the basics, not mastering the languages. There are many materials on the net where you can find "how to" tutorials and everything. W3Schools is about showing you what's all about.
  2. I knew XSLT could write JavaScript and VBScript, but ADO? Really?!?! Isn't ADO part of ASP which is a server side scripting language?Khm... anyway, we have our last problem here. As far as I understood, mona works with PHP. This would complicate the things a bit, scince unlike ASP, PHP doesn't have an XSLT processor .
  3. PHP doesn't have XSLT processor built in as I have stated many times. Unless you find a way to install some kind of extension (see php.net for details on this one), you can't make PHP process the XSLT unless you create your own XSLT processor with PHP itself. I don't know much about PHP, so I can't give you a sample of what I mean.And about the above example I meant for example a database which has a record like <hardware><ram>256mb</ram></hardware> And another record with for example <image><url>www.example.com/pic1.jpg</url><alt>pic1</alt></image> And now let's say we have a PHP file which creates an instanse of a container div for example and catches the data in the <hardware> element. It then displays it and actually shows that the content from the <ram> element is RAM memory. The same is done for the <image> of the current row.Normally, if this was ordinary XML, you would have to transform the data with XSLT and execute it with a server side language. But as said above, PHP doesn't have XSLT support. It does have XML thoguh.This approach is better then to keep each SQL data in it's own record, because it makes the data more structured and expandable. Instead of having another table for the images, you have a single column which contain it. However, this is not always better. Infact, there are not many cases, where this prooves to be usefull.
  4. Perhaps it's the namespace... I recently encountered simmilar thing. Try giving the RSS it's namespaces back. Also, execuse me for my lasiness, but you might want to try "isolating" the problem first. Apply all different changes and removals one by one and see where the problem first arises.
  5. Yes. You must insert the code from this topic in all of your XHTMLs and of course, adjust it properly. That code would display the transformation at the place of the element which has the appropriate ID.
  6. Not with data islands. With XSLT is simpler though. There's the <xsl:sort> element, specialized for this task.
  7. The Web Primer tutorial was written for cases like this. There's a link to it in the middle of the home page. It describes what a web developer needs to know and it practically follows the orders in which one should learn.In short I could say: XHTML, CSS, JavaScript, XML + some server side scripting language of your choise. It might be PHP, ASP, Cold Fusion, etc.The other tutorials are advises for optimizing your work, not for creation of web sites.
  8. Using relative sizes in your CSS for starters?
  9. What is that suppose to mean?
  10. boen_robot

    Navigation

    What do you mean by "navigation page"? A site map? Well, it's quite simple actually. Just have your menu data in some XML, transform it with some kind of XSLT and use ASP to execute that transformation. Example:xml <?xml version="1.0" encoding="utf-8"?><menu> <item> <title>Home</title> <link>#</link> </item> <item> <title>About us</title> <link>#</link> </item> <item> <title>News</title> <link>#</link> </item> <item> <title>Links</title> <link>#</link> </item> <item> <title>Images ></title> <link>#</link> <menu> <item> <title>Photos</title> <link>#</link> </item> <item> <title>Wallpapers</title> <link>#</link> </item> </menu> </item></menu> XSLT <?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="navigation.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="utf-8"/><xsl:template match="menu"><xsl:variable name="link" select="link" /><ul class="menu"><xsl:for-each select="item"> <li class="navlink"> <xsl:choose> <xsl:when test="menu"> <a class="hide" href="{$link}"><xsl:value-of select="title" /></a> <xsl:apply-templates select="menu"/> </xsl:when> <xsl:otherwise> <a class="navlink" href="{$link}"><xsl:value-of select="title" /></a> </xsl:otherwise> </xsl:choose> </li></xsl:for-each></ul></xsl:template></xsl:stylesheet> And the ASP from XSLT on the server example.With some CSS, the above could also be a menu (as it's root node implies). Infact, this is the XSLT of the first CSS only menu from cssplay. I'm having some difficulties getting the conditional comments for IE properly, but I'll do it soon hopefully.
  11. A much more speedy solution in my opinion would be for the database to contain the parts of the XML itself and the server side script would only have to assemble and/or transform the data there.
  12. boen_robot

    xml files

    Considering the fact that posting requres interaction with the user and the server, I think the classical approach for the server side scripted forum is better at this poing. Mostly for security reasons. Using XML for every item that doesn't need to be secured sounds as a good thing though. Think about every possible situation that the user might to with the fully accessable XMLs.
  13. The only way I can think of is to restructure the XML itself "manually". Instead of having <doctor><name><first>John</first><last>Smith</last></name></doctor> You could use <doctor><name first="John" last="Smith" /></doctor> And remove ALL line breakes and extra spaces. Example: <doctor><name first="John" last="Smith"/></doctor> But even this is not going to compress the data very much. Infact, that's the reason why XML was never ment to replace traditional databases such as MS Access, MySQL, Oracle and so on.
  14. The wrong is that you have used Data Islands which are supported ONLY in IE6 scince they are not part of any W3C specification, but only Microsft's. That's different from bilbob's problem though, scince the examples he gives use JS, which is more supported.
  15. What do you mean by "regular expressions"? Some kind of info? Anything?
  16. The first question: some kind of scripting. JavaScript that would manipulate a form perhaps?The second question: server side script is THE only solution. We are talking about a creation of a completely new file after all.
  17. If you look closely at your XPath expressions, you'll see the error. Doc is the root element of the document, so It's pretty obvious why this cycle repeats only once. I don't see much point of the list element though.If you are the creator of this XML (it's not generated by some application) I would suggest that you group your things to make them more easily accesable to the XSLT. Example: <list><host><name>hostname1</name><ip>192.168.1.100</ip><os>windows xp</os></host><host><name>hostname2</name><ip>192.168.1.101</ip><os>mac os x</os></host></list> With an XML like that, it's quite easier to set the XSLT to see what information belongs to which host so it could display each on a new row.Anyway, if this XML is generated by some application, I suppose I'll try to think of something else, but it would be quite messy, I know it.
  18. Technically speaking, even plain old HTML can't do this, so a plain XSLT won't be either. You need either a frame (bad idea) or a JavaScript that would hold the header on the top of the screen inside it's own frame.
  19. Actually, that part is correct. There must be a closing tag for the template element after all.The error I see is that you have used <xsl:value-of /> for the content. There should only be <xsl:apply-templates/> at that very spot.
  20. Place some kind of breackers in the XML file itself (why do you think the <br /> in HTML was invented for?) and then create an XSLT template with somethink like this: <xsl:template match="NameOfTheTagYouAreGoingToUseAsLineBreaker"><BR/> <xsl:apply-templates/></xsl:template> copyright: paetje
  21. In short: yes.To be more exact, you need the <xsl:sort /> element.
  22. boen_robot

    Images

    How about using a variable instead of attribute? <!-- Plaatjes --><xsl:template match="img"> <xsl:variable name="uri" select="@uri" /> <img src="{$uri}" /></xsl:template> Would this work?
  23. Considering the inconviniences that XSLT has over the plain XHTML, it's true that you need some server side language to... support it. XML based technologies are great, but the world is not entirely ready for them yet. By the time when IE10 comes out, they will be on their half way I think. So for any professional carrer, XML technologies are sure to come in handy for a large variety of purposes, but alone they are not much... yet.
  24. The only way I can think of would be for an XSLT that would create a schema from a predefined XML source that would serve as a model to the schema. In the XSLT you have IFs and CHOOSEs, so it sounds plausable. If there is a way with Schema itself, I don't know of it.
  25. "bandwidth" practically means the amount of data that is receiveed from a site. Images of cource take higher bandwidth scince an image file is larger then a text one. The same way, video files have a lot higher bandwidth and so on. Having optimized a site for low-bandwith would mean that you use text based technologies a lot more and you'll make them as compressed and small as possible.
×
×
  • Create New...