Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. If it wasn't for a portfolio, I would have said it sucks in comparrison with the previous ones .Well, I think it might be good if the links were avaiable hirizontally or placed below the search, instead of vertically on the right top, but maybe it's just me.
  2. I think the best way you may present things is by allowing the users to upload things via a main web site, which from then on would also be available to WAP. Thats the most sure way that no one will sue you, scince your users are responsible for themselves. Of course, as a good admin, you would be expected to delete each image and ringtone for which someone says it's illegal.This was all if you wanted the stuff to be avaiable for free, but you want it paid... hm.. well, yeah. The only way for things to be legal is to contact the producing company(es) and ask for copyrights. They would of course want percentage or something. I don't know. You'll figure it out with them. The key thing here is not to contact each movie/music producer. Instead, you would have to look for the producing comapny's president, because he owns everyone else. So, having a contract with the director of the Hulk is not the thing. Instead you would need to contact the director of... what company produced the Hulk again?
  3. I love the way your XSLT looks like. It almost makes me feel as all of my XSLT experiments were useless . In fact, that's the first time I see a working usage of the <xsl:apply-templates> where it comes as a really useful feature.Your XML could use a bit of recategorization though. You could group things that belong at one place. For example: <tag4><tag2>title1: </tag2><contents><tag3>content1</tag3><tag3>content2</tag3><tag3>content3</tag3><tag3>content4</desc><tag3>content5</tag3></contents></tag4><tag4><tag2>title2:</tag2><contents><tag3>content1</tag3><tag3>content2</tag3></contents></tag4> In this case, tag4 servs as a grouping for everything belongs to the particular title and contents and the contents element combines... well... yeah... all contents.Also I hope this is not the final version of the XML file you intent to use. Names such as "tag*" are horrible. Think of something with a meaning.--------------------------Anyway, let's get back to the problem. There are two ways of adding attributes in XSLT (which is practically what you need). I have described theese methods in detail here.
  4. Yes. That's the route of a server side scripting which basically allows you to do everything you otherwise would be unabled to do (thats how I usually define it). You can use server side includes, that let you write the full menu inside one file and put the content of that file directly in the main file.If you want to build the site on the client side instead, there are two other ways though: a vast usage of XML and XSLT, which on a later stage you might want to execute with a server side code (cause eventually, you WILL turn to server side scripting), or a single JavaScript that writes the code for the menu. Or a third (the best for starters in the client side ways in my opinion) is a combination of theese two: write the menu in XML and XSLT and use JavaScript in each XHTML to visualize the transformation within the XHTML file.There's also the third way of frames and iframes, but due to explainable reasons, everyone is avoiding them.Hope this will give you some ideas of what you can do. As you can see from my signature and profile summary, I have chosen the path of XSLT (I don't mean XPath ) .
  5. Similarly to the code above, replace <td class="data"><xsl:value-of select="CPhone"/></td> With <td class="data"> <ul> <xsl:for-each select="CPhone"> <li><xsl:value-of select="current()" /></li> </xsl:for-each> </ul> </td> It should show the desired output.
  6. XML is multiplatform way for carrying data. It can't compete with SQL and never had this purpose.If you have a catalogue, you'll sure save it within a SQL database scince it will expand rapidly.But what about simpler stuff such as interface data for example? Why would you need to carry your menus inside SQL database? No, you won't. You would carry them inside server side includes, right? Well, imagine that you would like to have a different XHTML or perhaps even a WAP site. What would you do? Use server side script that will choose appropriate other server side script that will do the stuff? And what if you change your host or change from PHP to ASP or the opposite? Remake the whole site? No way. You can have different XSLT stylesheets for each kind of platform and a single server side script that would execute the appropriate one. The thing will work despite of the server side script change and if you move, you would only need to change the script that chooses and executes the XSLT. Everything else (visual) will be intact. XML carryes the data which is transformed with the different XSLTs, so there's no need of server side includes or carrying the data over several server side pages.
  7. You need to install ASP, rename your file to .asp and place it at the appropriate IIS's folder. Then open your browser and type the appropriate URL into the adress bar.
  8. boen_robot

    Divs sizes

    Just give absolute dimensions(in pixels) to the div(width: ###px; height:###px;) and if it still doesn't work, add "overflow:hidden". As far as I know, this would hide every part of the text that passes the specified dimensions, thus keeping the div unchanged.
  9. Using XSLT alone and previewing the XML file, you can only see what the result will be like. To get the actual thing and/or manipulate it, you need a server side script.So there you go. You need a server side script, that will process the XSLT transformation, store the result, and save it as a separate file.
  10. I got another solution for you, but it's also a bit messy. It relyes on the position of the code. The last child of Afflications won't be displayed whatever it is. It doesn't spesifically target the Type node, which is the problem. Anyway... I also made some other modifications to the code if you don't mind. Such include:1. Moving the repeated CSS style attributes into classes at the head section.2. Making every appointment show instead of only the first one.3. There was a misspelling in your stylesheet for selecting the OHours. Fixed now.Here's the code: <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <style type="text/css"> td.header {border: 1px solid Black; vertical-align: top; color: white;} td.data {border: 1px solid Black; background-color: gray; width: 10%; vertical-align: top;} </style> </head> <body> <table style="width: 100%; border: 1px solid Black; background-color: green;" cellpadding="2" cellspacing="0"> <tr style="text-align: center; font-weight: bold; font-family: Verdana; font-size: 12px;"> <td class="header">Name</td> <td class="header">D.O.B.</td> <td class="header">SSN</td> <td class="header">H. Phone</td> <td class="header">H. Address</td> <td class="header">C. Phone</td> <td class="header">Affiliations</td> <td class="header">O. Phone</td> <td class="header">O. Address</td> <td class="header">O. Hours</td> </tr> <xsl:for-each select="EmployeeList/Employee"> <tr style="font-family: Verdana; font-size: 11px;"> <td class="data"><xsl:value-of select="EmployeeName"/></td> <td class="data"><xsl:value-of select="DOB"/></td> <td class="data"><xsl:value-of select="SSN"/></td> <td class="data"><xsl:value-of select="HPhone"/></td> <td class="data"><xsl:value-of select="HAddress"/></td> <td class="data"><xsl:value-of select="CPhone"/></td> <td class="data"> <ol> <xsl:for-each select="Appointment/Affiliations"> <li> <xsl:for-each select="*"> <xsl:if test="position()!=last()"> <xsl:value-of select="." /><br /> </xsl:if> </xsl:for-each> </li> </xsl:for-each> </ol> </td> <td class="data"> <ol> <xsl:for-each select="Appointment/OPhone"> <li><xsl:value-of select="current()" /></li> </xsl:for-each> </ol> </td> <td class="data"> <ol> <xsl:for-each select="Appointment/OAddress"> <li><xsl:value-of select="current()" /></li> </xsl:for-each> </ol> </td> <td class="data"> <ol> <xsl:for-each select="Appointment/OHrs"> <li><xsl:value-of select="current()" /></li> </xsl:for-each> </ol> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template></xsl:stylesheet>
  11. You are using UTF-8 as encoding, but yet you have characters on theese lines that aren't part of UTF-8's specification. Replace the appropriate characters with their numeric entities and everything will validate.
  12. What do you mean by "both of the cell number to show up"?As for how to hide the type. I think the cleanest (though structually looked, not the best) method, might be the <b> markup method, with adjusting the CSS to use "display: none" of course.
  13. I tryed making some experiments with this and I even looked at your previous posts for reference, but I still don't get it. I fell like a complete noob about asking this, but could you please post a full sample XSLT and XML code that will give the results? It's a lot easier for me (personally) to study full codes, than snippets. There's probably something other I haven't taken into consideration.
  14. You should learn CSS in more details I think. There is no such thing as "align". There is "text-align" though. To left align a table however, you should use "margin-left: 0 auto;". I'm not sure about this one though. I usually center elements(margin: 0 auto;), not left or right aligning them. If it doesn't work, "margin-right: 0 auto;" should work.I don't know how can a browser know when a word is abbreviation or a ordinary word. There are ways with other languages (server side languages, XSLT with XML, etc.) with which you can declare all acronyms at one spot and apply the <acronym> element for each one, but no way with pure XHTML and CSS. What you can do with CSS however would be to give a special styling for every acronym.
  15. boen_robot

    Hide advertise

    You can use JavaScript to manipulate the page's existing code. However, what Geocities does is to add advertisments with their own server side script, thus disableing you from removing it. Even if there is a way, it's probably against GeoCities' policies.
  16. Offtopic://Well, duh... that what the forums are for. To ask about specific issues for different languages. If you don't understand something, just ask in the appropriate forum. Someone will be there to answer you .
  17. Wouldn't it be best if you could get an existing chating system and modify it's source code? As for what's the best way... well... perhaps a combination of PHP and JavaScript. CGI is not needed scince it does the work in the same way as PHP. You should use JavaScript for all the different features such as smilies, text manipulations, etc. I think that using AJAX based techniques (writing and outputing everything in/from an XML file) you can also make a true type of chat. One in which everyone tracks the lines directly, not as in a forum, where you have to refresh to see the new thing. However, in order to keep the file size small, you'll need a PHP script that will remove older lines at some point and doing so for every line is going to take some considerable amount of CPU power.The "safest" way to do this is JAVA (not JavaScript, but the OOP language from Sun Microsystems) embed as an object. However, I don't think that any person here is experienced with it, so it will be hard anyways.
  18. W3C is not the same as W3Schools btw.They don't write anything in the IE or NN boxes if the attribute is not supported at all even in the latest available version.
  19. I'm not sure I understand completely, simple because I don't have much experience with the apply-template element. What's the deal? Where will that work? <container>In this example, is <bold>this text is suppose to be bold</bold> and the other part of the container a normal text?</container><bold>Or there has to be a single container for the whole bold text?<bold> If what I suspect is correct, this template should give a span with class bold to every bold element, no matter where it's contain and used(the <container> example) right?
  20. 2. I have tryed adding a template inside a template with the same match, and I know it gives an error. As for duplicate templates in one stylesheet. Yes. There isn't an error, but just one of the templates is processed depending on the parsers' settings. IE and FF both render the last template with that match, because normally things written below have a higher priority.4. I don't think that understanding this matters really. It's well defined, and we're suppose to follow the model, not reinventing it. But if you really need to understand it, you should know that "xmlns" applyes the namespace to the element it's used on and it's childs. "xmlns:{some extension}" is only valid if it's used at the root of the document which in our case is xsl:stylesheet. It applyes the namespace to every element with the selected extension. Scince the <xsl:stylesheet> has the funcition of defining the start and end of an XSLT transformation, it needs to have the xsl prefix. From all of theese you can see the following: <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform"> Valid, however, every element in it must be an XSLT element or either have a reference to another namespace every time you need it. This practically disables you to transform XML into another XML. <stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> Invalid. The stylesheet element will not be applyed, thus every XSLT element inside will also not apply. The only way you can overcome this is if this is the root and you include <xsl:transform> below this. <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform"> I'm not sure I can answer this one actually, but I think that "xmlns" would override even previously defined namespaces, so therefore, the result will be pretty much like 4.1.
  21. I think he means that he wants to use HTML inside an XML document and output the whole containg node, not simply having a <b> element inside XML .
  22. 1. Yes. Orginally there was only XSL, but it was then devided into XSLT and XSL-FO. Both of theese languages use XPath as a way of selecting elements and both refer to files with *.xsl extensions.2. The include statement can be called anywhere within the file as long as the included file doesn't make the whole thing invalid. For example, if there is a template inside the included stylesheet with match="/", and you call that stylesheet inside a template with the same match, this will give an error. Import is the sme as include with the only difference that it can only be called at the top of the document, before any templates.3. You just have to type the name of the desired template. XSLT doesn't allow duplicate templates, so there's no way of confusion. I haven't tryed calling a template from within an included file, but I think it will work as well.4. <xsl:stylesheet> is the beginning of the XSLT stylesheet. It's other equivalent is <xsl:transform>. There is no actual difference between the two, but W3C recommends using <xsl:stylesheet>. xmlns:xsl defines the XSL namespace, which you then on use inside the XSLT documet for every XSLT command. You can adjust the namespace URL, but if you do, it's likely that you'll encounter some problems. You can adjust the thing after the xmlns (the "xsl"), but then you would have to write every XSLT command with the new namespace instead. For example xmlns:xslt="http://www.w3.org/1999/XSL/Transform" would mean that all xslt elements must look like for example <xslt:stylesheet>.5. I personally don't like XSL-FO. I don't see any usage of it. XSLT can transform XML into XHTML and from then on, with different CSS stylesheets, you can make it good for printing, screen display and more.6. Normally XSL-FO is called as another file, the same way as XSLT (they were originally one language after all). Just like any language in the XML family, you can embed it inside an XML documet by calling the namespace, but there's no point, scince this will be messy and invalid and all. Don't embed any languages inside XML documents.7. Any data which should be extracted or has a possibility of expanding, should be written inside an element, and data, used for filtering, finding and other kind of "functional" purposes should be used inside an attribute. Of cource, this is not a "must". It's just a recommendation for a good and clean code.8. Yes. All the records are saved inside one file, each inside it's element. That's why we say that XML can't replace SQL databases. You can however, store small XML documents inside records of SQL database, use a server side scripting language to generate XML file from it and use XSLT to display that data. Cool, isn't it.9. You just write the data inside the XML document. That's what XML's purpose is. To carry data. Any text editor (such as notepad) can write all of the documents involved, so there's no "must" for any additional tools. If you view the XML file with previously applyed stylesheet, you'll see how the end result will look like. To see the XHTML source though, you'll need a server side script that would execute the transformation. See the "XSLT on the server" example to see what I mean.10. XQuery is a bit different then XPath. XPath is what URLs are for the browser and XQuery is what SQL statements are for a database. They have different purposes. I personally don't know much about XQuery, because I haven't got a need for it.11. XSLT files contain XHTML that would be outputted and their own XSLT elements, that are used to select and transform XML data. That's the way you bind the two. It's not ugly looking, especially if you format (indent) your code well. Refer to my previous posts in this forum and the XSLT tutorial for examples.Oh... that were a lot of questions. I felt as if I'm on an exam or something .
  23. The only OTHER way I can think of is by placing another element that will contain the actual number and output that number instead or choosing the element "manually"...I mean.. why don't you want to use the max() function? In what other way you'd expect XSLT to perform a function's action? Oh well... server side script?
  24. It's just that block elements have different abilities, which inline elements don't have and vice versa. For example, block elements can have explicit demensions, which is why sometimes you see links being displayed as blocks. I don't know other differences though.
  25. What if you make a separate stylesheet for the included XSD and include the corresponding XSLT when XSD is included?
×
×
  • Create New...