Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. boen_robot

    Linked Styles

    I'm not seeing the big picture.You can use multiple classes on elements and IDs to specify reusable styles and specify styles for elements that have two or more styles present. What more could you want?
  2. boen_robot

    Two CSS styles

    The priority of stylesheets is based on the order they are being ilnked. A later imported stylesheet has higher priority. So, scince general.css was called before index.css, all styles in general.css have lower priority then index.css. In other words, every style in index.css will be used, even if general.css specifies something else for that style.
  3. boen_robot

    List Fixing

    Actually, I think that currently, it looks great. Otherwise, horizontal scrollbars will appear and believe me, those annoy people a lot more then a few lines of products.The only way I found to make all products on one line, at resolution of 1280x1024 is giving "#letterprod ul"a width of 1265%.Not only that, but "#letterprod ul" is actually a replacement for the "#a, #b, ..." seletor (which is the same thing, but longer, though more precise.
  4. Get yourself Office 2007 beta. As far as I know, it's free and lasts until the official version is out (I got it from a magazine... weird). It has a direct option of exporting documents to PDF and it's XML format is better in terms of readabilty then the one Office 2003 is using.
  5. Everything that's not in XSLT's namespace could be anything you want. So, instead of using <xsl:value-of select="title"></xsl:value-of><xsl:value-of select="description"></xsl:value-of><xsl:value-of select="link"></xsl:value-of> you could simply add the desired element around those. And for goodness sake, write empty elements with "/>" will you? <title><xsl:value-of select="title"/></title><description><xsl:value-of select="description"/></dectiption><link><xsl:value-of select="link"/></link> <xsl:value-of/> just outputs value. Or should I say "text". It doesn't copy the elements and their attributes. If you want that, you can simply use a single xsl:copy-of instead, like this: <xsl:for-each select="item[node()[contains(translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') ,translate('java','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))]]"><xsl:copy-of select="."/></xsl:for-each>
  6. If you have Dreamwaver 8, or another good WYSIWYG editor, you could use it's own validator.
  7. Hey, I just got a brilliant idea!In order to edit an XML document, you could generate the XML data that you'll be adding, and use XSLT in order to place that data in the right spot. The output itself should completely replace the old XML file.With PHP5, it's easier, because you just have to use the transformToURI() function, but in PHP4 you have to first generate the output, get the old file's name, delete that file and create a new file with the output as it's content.An XSLT that may do a good job is something like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:param name="input"/><xsl:template match="/*"><xsl:element name="{name()}"><xsl:copy-of select="*" /><xsl:copy-of select="$input"/></xsl:element></xsl:template></xsl:stylesheet> where the parameter $input contains the... input of course... that is passed to it.Using this particular stylesheet will place the whole input just before the closing tag of the root element.Editing existing entries might involve generating a new "input" from the old XML file that will have the desired data, a second transformation with the XML without that data, and a third transformation to use second output as it's input and pass the first output as a parameter for the same transformation above.
  8. A simple <img><xsl:attribute name="src"><xsl:choose><xsl:when test="images/thumbs/image"><xsl:value-of select="image" /></xsl:when><xsl:otherwise>default-picture.jpg</xsl:otherwise></xsl:choose></xsl:attribute></img> Would do it. I mean, the node test checks if there is an <image> element on that position.But wait... what type of structure is your XML? What I'm showing works with something like for example <images><image><full>picture.jpg</full><thumb>picture-tb.jpg</thumb></image>...</images> But if I'm understanding correctly, your structure might be something like <images><full><image>picture.jpg</image>...<full><thumbs><image>picture-tb.jpg</image>...</thumbs></images> If so, then, do you at least have some IDs on the images? I mean, if not everyone has a thumb, this is a good to have.
  9. What you did was to define a raw piece of code, that when transformed with XSLT results in an HTML link. But that's not XML link on it's own. Just a text, that get's specially transformed.
  10. boen_robot

    List Fixing

    Exactly what you need to have on one row? That's the thing I'm personally not grasping.If it's the lists of products on each letter, try something like: #letterprod ul {white-space: pre;} or #letterprod ul {white-space: nowrap;}
  11. Creepy. I would never give my peny and/or $9.95 dollars for this. If this host was truly a host, he would have at least got himself a real domain.As for this cjb page... why exactly do they need my email again? I mean, aren't they just redirecters? Couldn't I just have a login and that's that.
  12. boen_robot

    Switch Question

    Isn'tif(!empty($_GET['img']) a shorter variation of that?
  13. boen_robot

    Nav bars

    Read man... read.CSS is like an "add-on" for HTML, so yes. You can use it if the rest of the site is in HTML. Infact, as you'll see in the tutorial, you can create one CSS file and use it across all pages. When you edit something there, all pages will look the new way.Example? a {/* Styles for all "normal" links}a:hover {/* Styes for all links when the mouse is over them */} Read from the start to find out how exactly to declare all you need to and where to place all of this.
  14. boen_robot

    Nav bars

    Yes, there is a lot more simpler way. Use CSS for links and use the :hover pseudo class for the alternative style when the mouse passes over.Read the CSS tutorial for details, and know that :hover is supported only on links in IE6. IE7 supports it on all elements.
  15. By using a pattern. The pattern itself is a regular expression. For example: <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[a-z]"/> </xs:restriction></xs:simpleType> means that the node using this type could only have a string that contains only lower case latin letters. You can also use the built in schema data types. For example: <xs:element name="age" type="xs:integer"/> means the element "age" can only contain integers.If you could tell any sort of pattern your data matches to, there's always a way to match it against some regular expression.
  16. Perhaps using both a min/maxInclusive and a pattern with a negative selection would do the trick: <xs:simpleType> <xs:restriction base="xs:integer"> <xs:minInclusive value="0"/> <xs:maxInclusive value="511"/> <xs:pattern value="(?!([1-3]|9|[12-13])$)"/> </xs:restriction></xs:simpleType>
  17. I'm not that experienced with Schema yet, but I think including a schema is the same as to have it directly typed in there.So, perhaps something like this might help: <element name="root_second_child"><complexType name="three_type"><element ref="one"/></complexType></element>
  18. Regular expressions are case sencetive. So [a-z] is different then [A-Z]. If you want to allow both lower case and upper case letters, you need to use [A-Za-z].Also, your <date> element contains a whole date, not only years, so you need to use xs:date for it instead of xs:gYear.Last, but not least. Try to shorten repeating patterns. Instead of writing [0-9][0-9][0-9][0-9][0-9][0-9], you could write [0-9]{6,6}. The first digit in the parenthesis means the minimum amount of times the previous character (in this case: a number from 0 to 9) must appear, and the second is the maxumum number of times. You may omit the comma and/or any of the numbers, but that doesn't work with all validators. The above way works in every validator that supports parenthesis.
  19. This topic has it all explained.
  20. The XSLT namespace is xmlns:xsl="http://www.w3.org/1999/XSL/Transform" if that is what you mean. Scince you'll be writing text, I don't see what other namespaces you need.
  21. I'm just wondering... why are you suggesting stuff still... I mean I do agree that if there are only two languages if/else is enough though anyway.
  22. I don't see anything weird and foreign. It's a simple frameset.
  23. There is the URL Rewriting Guide from Apache if you're using Apache as your server. As you can guess, this makes it REQURED for you to have control over the server.
  24. It is exactly my point that what you want is not possible. In order to create a link in an XML document, you need to define an element to carry it and that's it. You can't define part of the text as a link. But you can target a text with a link.
×
×
  • Create New...