Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. If the name of the attribute (in this case "name") is known and consistent (doesn't change of some criteria and always exists), then you could use a variable and pass it's value to the attribute. Like this: <xsl:variable name="name" select="PathToTheSpecialValue" /><bar name="{$name}"> If it's varying and it's not known if it exist, you must use the method I showed you in the other topic (the one including xsl:attribute in it).[edit] Oh, I forgot. You can actually open the variable and have all kinds of things in it. Then it's whole output would be passes instead of the single XPAth expression. Something like this: <xsl:variable name="name">Some weird stuff you'll want to do</xsl:variable><bar name="{$name}"> [/edit]
  2. Hmm... try adding the URL to the DTD. Something like: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Still seems really odd actually. I'm starting to ask myself if you actually have the lastest FF (it might be some old version's bug...). I've never had this issue. If that doesn't work, then I'm out of ideas. You're welcome .
  3. We've got a winner! In HTML 4.01, there is no slash at the end of the link tag and that's why FF ignores it- because it's not valid. If you use the XHTML DTD, then it should work. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Or for strict 1.1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  4. Yup. A really long post and I must say I'm not going to read all of it. Let me just suggest a general idea which I think I mentioned before, but anyway...Try isolating the IE issues in their own stylesheet. Then call the stylesheet with a conditional comment like this: <!--[if lte IE 6]><link rel="stylesheet" media="all" type="text/css" href="iestyle.css" /><![endif]--> That way, you'll be clear to make your site work in Opera and Firefox, which should be relatively easy, scince you won't take the buggy IE into consideration.
  5. That's odd... are you in qirks mode or strict mode. In other words, do you have a doctype? That might be the problem (but I have never encountered it though).
  6. So what I get is that the current XSLT is pretty much something like: <xsl:for-each select="foo"><foo name="{position(current())}"><xsl:copy-of select="./*"></foo></xsl:for-each> Or what? I mean, it's pretty useless not to use the star when all elements are different. If that doesn't work, then perhaps changing the path to only "." or possibly "descendant::current()"?By the way, you gotta be kidding me for the way your XML looks. The contents of the bars can't begin with a closing tag .[edit] I don't think you got my idea. In bar1 you have </something> which technically speaking is a closing tag to the opening tag <something>. If you meant an empty element, it would have been <something/> [/edit]
  7. I managed to do it, but in a really odd way actually. Probably because of the just as weird way I've installed IE7. This XHTML: <?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>test</title><link rel="stylesheet" media="all" type="text/css" href="style.css" /><!--[if gt IE 6]><link rel="stylesheet" media="all" type="text/css" href="ie7style.css" /><![endif]--></head><body><div id="header">Header</div><div id="leftnavigation"><h2>Menu</h2><ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> <li><a href="#">Etc</a></li></ul></div><div id="content"><h2>Sample Content</h2><p>This is the content section of the page. This is the content section of the page. This is the content section of the page. This is the content section of the page. This is the content section of the page. This is the content section of the page. This is the content section of the page. This is the content section of the page. </p></div><div id="footer">Footer</div></body></html> Where the style.css file has exactly what the page scott100 has and ie7style.css has the following fix. #content { min-height: 140px;} If anything changes in later releases, it would be very easy to fix .P.S. The way posted here does not work for me, because of the weird way I installed IE7, but it should work in a "genuine" version of it.
  8. boen_robot

    How to

    Well, I think that's what the Web Primer tutorial was written for. The order in which one should study the languages is similar to the one in the tutorial itself and where to begin... what better place then W3Schools? If you don't understand any line at all, then you should probably teach yoursef some basics with computers in general. If only certain things are unclear, then you may ask theese things in forums such as this one. Only try to read the whole tutorial before you ask.
  9. I'm not exactly sure what you mean with that <ip> thing...As for unchanged elements, I think they would be copyed directly. If not, then I think you should create another template for them and call it when needed. Something like this might do it: <xsl:template name="same"><xsl:param name="current" select="."/><xsl:element name="{string($current)}"> <xsl:if test="@*"> <xsl:for-each select="@*"> <xsl:attribute name="{local-name(@*)}"> <xsl:value-of select="@*"/> </xsl:attribute> </xsl:for-each> </xsl:if><xsl:apply-templates/></xsl:element></xsl:template> And when in situation where you're sure the elements are the same just use: <xsl:call-template name="same"/> Note: I haven't tryed any of this stuff.
  10. The footer comes back to the content in IE7. Not sure why... PM me if you don't have IE7 so we could find a way to make this work in IE7 too .[edit] Good point. Well, from what I see on first sight, min-height is now supported in IE7. It might be the thing driving the whole thing down. Also for the content you have used a combination of percentages and pixels. Is that a hack of some sort? [/edit][edit2] It could be the use of quirks mode. There isn't a doctype in your document which affects IEs behaviour (as it should actually). I must say I'm trying to run both IE7 and IE6, so it's pretty darn hard to make tests, but I'll try editing some...[/edit2][edit3]So far, putting it in strict mode with the doctype and adding the xml prolog to ensure IE6 still reads it, leads to a big mess with the positioning of the left column (but yeah, the footer is positioned correctly).[/edit3]
  11. Did you used any CSS hacks to place that onto it's place? If so, try to isolate that hack into a separate stylesheet that you would call with IE6's conditional comment. Or perhaps think of some way to get it work in IE7 and use that way into a separate stylesheet for IE7. If all else fails, try asking in IE7's newsgroups. If this is browser bug, it should be fixed, but I do think (even without looking into the code) that it's some sort of hack.
  12. would i have to change the style tag from <style type="text/css"> to <style type="text/css2"> to use this property? No, you wouldn't. CSS2 has the same MIME type as CSS1 which is still text/css. when you view the page in print preview it will automatically set it to landscape view? I think so... as long as the browser supports this property.
  13. It would be a lot easier if you know the structure of the document. For example, if a certain element is only renamed in the different versions, you would do: <xsl:template match="OldElement"><NewElement><xsl:apply-templates /></NewElement></xsl:template> If it's removed, then I think you might be able to do something like this: <xsl:template match="RemovedElement1|RemovedElement2|RemovedElementN"><xsl:apply-templates /></xsl:template> If there is more complex stuff such as same elements on different places, then it will get harder.As for "copying and then modifying"... that's not exactly an option. It's more like "modify and copy the rest" . To just apply everthing as it is, I think you should do something like: <xsl:template match="/"><xsl:apply-templates/></xsl:template> But then again, this means you have to declare the change of every element I think. I'm not exactly sure to be honest. I haven't tryed such "massive" convertions.There's also the <xsl:copy-of> but that doesn't allow for futher modification.
  14. boen_robot

    convert asp to php

    Look at the second question on this page.
  15. XML files are only plain text with tags, so yeah, they are searchable. The problem however is that there isn't yet a language that provides a mechanism equal to SQL with which you could check up and/or manipulate speficic data. There is XQuery coming though, so at one point they will be equally searchable. Until then, in order to create a search engine for XML file(s), you would have to be a bit more creative then with MySQL.
  16. XSLT is the answer to all of your "listed" questions except the last one. When opened with a browser you see the new XML, but you don't actually get the file itself. You must use a serer side scripting language or some specialized application to execute the XSLT transformation and generate the new XML file.Note that there is some way (not exactly sure what, but there is) to generate a new file based on a schema, but there isn't one for DTD. You must "manually" write the complete rules the XSLT would follow.
  17. As far as I know, databases could be accessed remotely if you just know the username and the password. Are theese databases yours? If so, then you don't need WebServices. You would need them if the data is not stored in a database but rather generated at the moment.
  18. Most of the time it depends on things such as... how is this data used? What's it for?I like to think that MySQL should be used for catalouge purposes, while XML should be used for everything else. For example, you would store personal user's settings in MySQL scince they have to be private and XML files are insecure after all.You should also store different products' data in MySQL, scince the user should only see a certain amount of products and their data at times and MySQL is kind'a more dynamic then XML.Every "per page" and "global" data however could/should be stored in XML, scince it's part of the overall site's "feel". In the case of a manual, I would say you could/should store each topic in it as an XML file scince the data is "static" instead of having the same type of data varying in each page.XML should also be used if this data must be avaiable on more then one device, simply becuause of easier maintainance. For example interface data (which is also a "global" data, so the previous criteria also applyes). Certain things such as "Home", "About Us" and other things you might add but yet look different on different devices. Those things could easily be manipulated within a single XML file and yet been handled smoothly.In short, XML should be used everywhere where plain XHTML faills in terms of easier maintainance. Everywhere you would use MySQL database anyway, use it.
  19. I told you like thousand times to try and use the XSLT for tabularising linear data. For the sake of completeness: <?xml version="1.0" encoding="windows-1251"?><!-- DWXMLSource="dictonary.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.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/><xsl:param name="group-size" select="9" /><xsl:template match="/Sudoku"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/> <title>Untitled Document</title> <style type="text/css"> td {border: 1px solid #000000;} </style> </head> <body> <table> <xsl:apply-templates select="Row/Number[(position() mod $group-size) = 1]" /> </table> </body> </html> </xsl:template><xsl:template match="Row/Number"> <tr> <xsl:for-each select=". | following-sibling::Number[position() < $group-size]"> <td> <xsl:choose> <xsl:when test="@problem='yes'"> <xsl:value-of select="."/> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </td> </xsl:for-each> </tr> </xsl:template></xsl:stylesheet> And edit your XML to be something like <?xml version="1.0"?><Sudoku> <Row number="1"> <Number problem="yes">1</Number> <!-- All other numbers on this row below.--> </Number> </Row> <!-- All next rows below.--></Sudoku>
  20. Where's the url thing? Try something like:body {background: url(http://www.comparestoreprices.co.uk/images/unbranded/h/unbranded-hues-of-lilac-wallpaper-10m-x-52cm.jpg); font-family: "Arial", Arial, Helvetica, sans-serif;}
  21. Well it should. What the "type" attribute in the <script> does is to tell the browser what content the file has. Scince server side scripts are processed on the server and the browser gets a client side script code, the browser should be aware what is the content it sees... it our case JavaScript, but it could be VBScript as well.
  22. Simple. IE has this behaviour that it allows JavaScript to be called with the expr/**/ession() function with any CSS proerty. It's something MS thought will be "cool" and allow things such as a varying width, depending on the screen resolution, but as others pointed already, it could actually lead to malicious code.
  23. Just from curiosity, what does the "/" do?[edit]Ah, I see[/edit]
  24. I just read some tutorial on regular expressions... I think this might do the trick: \[\?.+\?\] I just read it, so I might be wrong .
  25. Isn't that THE most frequently asked question...Two general ways- xsl:variable and xsl:attribute:with xsl:variable <xsl:variable name="ID" select="@ID" /><td id="{$ID}"><xsl:value-of select="Column"></td> with xsl:attribute <td><xsl:attribute name="id"><xsl:value-of select="@ID"></xsl:attribute><xsl:value-of select="Column"></td> If you mean that you want to use this ID multiple times, then I suggest you don't. IDs in XHTML should be used only once per page, not several times (scince there isn't a way to define a column in XHTML, having each cell belonging in the column with a particular identifier is the only label-like method).
×
×
  • Create New...