Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. 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.
  2. 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.
  3. 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.
  4. 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>
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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 .
  11. 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.
  12. 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.
  13. 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?
  14. 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.
  15. 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 .
  16. 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 .
  17. 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?
  18. 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.
  19. What if you make a separate stylesheet for the included XSD and include the corresponding XSLT when XSD is included?
  20. I didn't quite get it... is the whole "<TABLE FRAME="NONE"......." part of the XML or an XSLT template?If it's part of the XML, then it's easy... just create a variable that would select the value like this: <xsl:variable name="COLS" select="TABLE/TGROUP/@COLS" /> and call it at the place of the "hard code" like this: <td colspan="{$COLS}"> Hope this is not some kind of XSLT template, cause it looks pretty not XHTML like.
  21. That's because entities must be declared with a DTD in the XSLT. Add this in the XSLT right after the XML prolog: <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "™"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY pound "£"> <!ENTITY yen "¥"> <!ENTITY euro "€">]> As you can see, there are also other popular entities declared here. You may declare your own entities as well.
  22. The reference for the background is a URL. Therefore, it should be written with forward slashes instead of backslashes. Try it like this: body {background-image: url("images/clubhouse.jpg")} If it doesn't work, try to move the image in the same folder as the CSS and the HTML and remove the "images/" of course. If it still doesn't work, then... well... I have no idea.
  23. Perhaps if you make another element which would contain references to the images. Such as <images> <image> <src>http://domain.com/image.jpg</src> <alt>Some alt text</alt> </image></images> Or... hm... doesn't putting an <img /> tag and using a "value of" element work? Oh, yeah, I forgot... this is a thing I'm trying to figure out. I guess the pattern is the same as with the <b> and <i> tags.
  24. I'm not sure I understand you completely. As it is, you have provided some weird kind of code(the "./" consuses me) and it's not completely clear what are you asking for.You should make some more "isolated" test to see if it's possible to call a variable inside a variable. In fact, I think of making ones actually .the document() function should refer to a URL, not to a variable. If the URL's value is suppose to be the same as a variable, I think you could use brackets( "{" and "}") around the variable's name. Like <xsl:if test="document({$hxml})"> However I must say that putting a variable as part of an XPath expression is an issue I'm still trying to figure out, so this might not work. Hmm... anyway... if the above doesn't work, try it like this: <xsl:if test="document({$hxml})/*"> This would mean if there is any element inside the pointed file. After all, IFs usually adress nodes and attribute values as it is. I don't know if they could also check for files.
  25. Well, it's possible if the entered value is saved in some XML (by server side script) and then extracted with XSLT.<xsl:variable select="document('path to document')/path to the value" />
×
×
  • Create New...