Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. XML Schema is only needed if other people besides you are going to write to the document. If you'll be the only one using it, you don't have to do this.As for XML and XSLT, start with the XML tutorial and then go to XPath. Only then, you'll be ready to go to the XSLT tutorial where the fun part begins.
  2. O'REILLY's XML books are a good start, though I guess the one you in particular need is .NET & XML. WROX's XML books are also great, and they too have what you might need: Professional ASP.NET 2.0 XML.
  3. It could be. Try to report it in the mailing list. If it turns out it's not, then what you can do as a workaround is to replace the noscript element with another one (like span for example) and apply a replace of it's text with JS.
  4. Nope. I've never even heared of this Avsust (in English "August" btw) Str.Of course it's somewhere in Plovdiv. Never hided that to begin with .576 euros? That's interesting and new. Didn't know my ISP pays that much. But I certanly don't. I pay about 20BGN which is about 10 euros. And for that, I get (time for a little indirect advertising ) my own public IP, a local traffic of 100MBit/s (average of 2MB/s but capable of up to 12MB/s) and international of about 10-20KB/s.Well, thanks for letting me know the ISP keeps personal information personal . I mean, the nearest stadium is definetly not a western one (there are 3 stadiums in that area). If it's for walking, I can practically walk the whole city if I wanted to (though I would never). It's not as big as New York for example .
  5. boen_robot

    XML PHP Login

    And how exactly do you set the server to allow it's own CGI scripts to fetch the file and forbid all other access to it at the same time?
  6. Haha... good one. And where am I (my street adress I mean)? You are a mod, so you should be able to see my IP . Then again, my ISP shows its information (their office and the such) instead of the ones of it's customers, but who knows .P.S. I'll become one heck of a paranoid person if you guess the adress correctly from the first time .
  7. If it's only the phishing filter, why don't you just warn the envolved parties to disable the filter (but still use IE7)?
  8. Maybe it's because your <option> elements aren't closed.Try: <option value="1" label="0" >Standard (No extra cost)</option> <option value="3-D" label="2">3-D(+ £2)</option> <option value="3D Carbon Domed" label="20">3D Carbon Domed(+ £20)</option> <option value="Batman" label="1">Batman(+ £1)</option> <option value="Carbon" label="4">Carbon(+ £4)</option> <option value="Chowfun" label="1">Chowfun(+ £1)</option> <option value="Dark Side" label="1">Dark Side(+ £1)</option> <option value="Daytona" label="1">Daytona(+ £1)</option> <option value="Debussy" label="1">Debussy(+ £1)</option> <option value="Digital Machine" label="1">Digital Machine(+ £1)</option> <option value="Embossed" label="2">Embossed(+ £2)</option> <option value="Flying" label="1">Flying(+ £1)</option> <option value="Frankfurter" label="1">Frankfurter(+ £1)</option> <option value="Graffiti" label="1">Graffiti(+ £1)</option> <option value="Gunship" label="1">Gunship(+ £1)</option> <option value="Handel" label="1">Handel(+ £1)</option> <option value="Impress BT" label="1">Impress BT(+ £1)</option> <option value="MicroGramma" label="1">MicroGramma(+ £1)</option> <option value="Mistral" label="1">Mistral(+ £1)</option> <option value="Shop" label="1">Shop(+ £1)</option> <option value="Swiss 911" label="1">Swiss 911(+ £1)</option> <option value="Vitamin" label="1">Vitamin(+ £1)</option>
  9. Honestly said- I do mind. Why on earth would you take on this task if you simply can't do it? If XSLT is not your thing, but you can do HTML and server side scripting (or JavaScript) why not use that instead for the project and then learn XSLT when you're free?
  10. I would prefer reading this then unlimited actually. Otherwise you might eventually reach higher values and get banned for nothing (well... nothing written anyway).
  11. boen_robot

    xpath

    It depends. Will that maxum number always be equal to the number of <records> elements? If so, then it's simple: records[id=count(../records)]
  12. The way I see it in the preview, NONE of the answers is displayed. Only the questions. And scince this is suppose to be a test, I think this should be the correct behaviour, no?As for the line break, that's simple. It's because both the number and the question are in <TextData> elements and you define a new table for each of them. Each table is displayed with a line break by default. To change this behaviour, you must either generate the numbers based on the position (as I suggested in the last post) or add a CSS like "table {display: inline;}" which will remove the line breaks.
  13. boen_robot

    XML PHP Login

    It's a bad idea to store passwords in XML. If anyone knows the location of the XML, (s)he will be able to see all usernames and passwords in plain text. Of course finding the XML will be the harder part, but scince it will be publically available, that would still not be impossible.For secured data, using an SQL database is THE only secured way.
  14. True, but that doesn't remove IE you know. It only removes the shortcuts. If a messanger (like ICQ for example) was installed on that machine, it will keep opening links in IE, instead of the default browser (if set to another one) which will still grant access to IE for the user.
  15. Well, unfortunatly, XSLT doesn't provide a method for conditional includes. But when I need such a thing I do another thing which is pretty close. I like to call it "deductive include".The method is pretty simple and is easy to think of, if you just spend some time on it. When you process the RSS, call XSLT that contains RSS specific transformation. From that XSLT, include the common stlesheet like the one above. In the same fashion, when you call your main page, call an XSLT that will perform the main page specific transformations and include the common transformation in that specific stylesheet.However I gather the RSS doesn't contain a caption and content element nor are the title and all rest under a "page" element. So, in order to handle both cases, the easiest way is to add a mode and apply only the templates with that mode on. For example: <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <html> <head> <title> <xsl:choose> <xsl:when test="rss"> <xsl:apply-templates select="title" mode="rss" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="title" mode="main" /> </xsl:otherwise> </xsl:choose> </title> </head> <body> <h1> <xsl:choose> <xsl:when test="rss"> <xsl:apply-templates select="channel/description"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="caption"/> </xsl:otherwise> </xsl:choose> </h1> <xsl:choose> <xsl:when test="rss"> <xsl:apply-templates select="item" /> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="content" /> </xsl:otherwise> </xsl:choose> </body> </html></xsl:template></xsl:stylesheet> And the stylesheet that will have specific transformations, the templates will have to look for example: <xsl:template match="rss/channel/title" mode="rss"> There are of course other variations, but they all involve deductive including.
  16. What do you mean? It looks all good to me... other then the fact that the last question has "1." instead of "7." but that's just a minor error in the XML. What exactly do you need? Automatic position detection? If so, then get rid of the textData element that carries the position, or rename it and in the XSLT, use something like: <xsl:template match="TextData"> <table> <tr> <td> <xsl:value-of select="position()"/>. <xsl:apply-templates/> </td> </tr> </table></xsl:template>
  17. I think the function is designed to work from a link. I'm not good at JS, so I'm just guessing.
  18. To paraprase what justsomeguy is trying to say, hacker forums are for Skiddies and skiddies are not good people nor are they any "hackers". Don't be a bad guy... when you find a flaw, help fixing it, instead of exploiting it and reporting it to unsoliced parties that will abuse it. And don't exploit flaws found by others.
  19. I've hearead of something called the "muncian method" (or something like that) of removing duplicates, but I don't understand it completely yet, because it uses xsl:key which is my weak spot. Without it, there's the EXSLT distinct() function, as well as the XSLT 2.0 distinct-values() function. I know that libxslt (available with PHP5) supports distinct(), but I don't know if Salbotron (PHP4) does too. And distinct-values() is out of the question. Only Saxon supports it and it is avaiable only for Java and .NET.
  20. The question is indeed trivial, but scince it's not descibed in the tutorial when it should be, I understand you and thus, will assist you .You must use the <xsl:param> element as a top-level element. In other words: <xsl:stylesheet version="1.0" ...><xsl:param name="price"/>...<xsl:template match="/"><xsl:for-each select="catalog/cd"> <xsl:if test="price=$price"> ... </xsl:if></xsl:for-each></xsl:template>...</xsl:stylesheet> When the user fills out the form, it will most probably be sent to a server side scripting page, right? So, in that case, you can execute the transformation with that language and return the output. All processors can also pass parameters to the stylesheet to influence the output. For example, in PHP5 you can assign a parameter to the XSLT processor with something like: $processor->setParameter(NULL, "price", $_POST['user_entered_data']); The complete code of course is longer, but this is the parameter line.Depending on what language you use to execute the transformation, the ways vary. The only way to set up a parameter without a server side script is with JavaScript, but JavaScript will only work if the form is on the same page as the results. This post shows a script that can change a parameter of the XSLT that is currently in use.[edit] Whoa. That's the first time I've been beaten up in this section. Today is a very weird day. Only new things happening . And... is time running faster then usual or am I just sleepy?[/edit]
  21. If I have followed all of what justsomeguy says, the code you need is: if (!empty($_GET['page']) && !empty($_GET['id'])) {$args = array('page' => $_GET['page'], 'photo' => $_GET['photo']);} or in other words, if both parameters are present and non-empty: set them. Otherwise, leave both of the XSLT values intact.
  22. Wow. You're certanly on fire today .I feel bad that I don't have other things to throw at you right now while I have the chance .Wait, I just remembered I do .Simple XML xpath() function returns a multidimensional array. What I wonder is how to access multidimensional arrays. For example: Array ( [0] => SimpleXMLElement Object ( [0] => A result of the query ) ) How to access deeper levels of this array? And is there a way to detect if there is another dimension in the array and progress on it if so, instead of always processing a selected dimension as a whole.
  23. I think for this specific case, the switch might be more appropriate, though I appreciate the alternative approach.But thanks for the "=" and "==" tip. I didn't realized there's a difference. Wow, 10 minutes and I already know more about PHP then ever before (and yes, I know that's just the start) .
  24. OK, but that doesn't answer the main question. How to do this check on two variables with one condition? I mean, I understand that two subsequential "if"s will work, but could a single condition check if two variables are set?
  25. right... switch.... I read that once upon a time and I forgot about it's existence! Damn, I ask the most noobish questions around . Shame on me.
×
×
  • Create New...