Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. If the server has PHP support disabled, you won't be able to enable it just like that. Also, I think AddType is only relevant when PHP is running as a CGI binary, but it might be running as Apache module.
  2. Hey! You asked for such a problem on purpose! You knew I'll reply next and that I can best come up with an issue like that, admit it .The PHP script must begin with "<?php" and end with "?>". Also, I'm not sure, but I think the fixed POST variable is case sencetive. In preg_.*() functions, regular expressions must be enclosed by "/" and so the completely working code should be: <?php$the_match = $_POST['match'];$34regex = "/#^[a-zA-Z0-9]+$/";if(preg_match($34regex, $the_match)){echo "Match Valid";}else{echo "Invalid Match";}?> I'm not sure about the "<%php" though. It might be legal, after adjusting the server.Anyhow, let me start with pure XML, so that there could be someone to solve it...Make the following a well formed XML document, without adding new nodes. Rename the existing ones by will if needed for the sake of well formdness. Avoid removing nodes, unless the only other way is adding a node. The rest is irrelevant: <?xml ver="1' utf-8"?>><root element><elemene><!--OMG. This won't be read.... -- Help --><elemenet/></element><1atri barti="ute"/></elemene><1atri>barti<ute/></ati><</elemene></root element> I'm intentionally making it really broken, so that you couldn't simply launch it into the browser and be guided by error messages.NEXT (in order of preference): CSS, XHTML, PHP.
  3. Not exactly. It's a completely new specification with it's own new elements ("tag" is not the same as "element"). It is designed to be embedded in all XML based languages for gathering data, taking XHTML and SVG as a priority.
  4. To be exact, when characters are grouped, the rest of the regular expression treats them like it treats a single chracter. So[._-]* is zero or more occurances of the characters in the range, and [._-]? is zero or one occurance of the characters in the range, etc.
  5. The "+" is applyed over the complete range (as with a group). So the "+" in the above states "one or more occurances of any alphanumeric character, a dot, an underscore or a dash".[._-] means "a dot, an underscore or a dash". Nothing more and nothing less.
  6. Not that it's not "supported" but it's "deprecated" in more recent versions (XHTML 1.1). I think PHP recognizes elements by ID. Try it for yourself to be sure. If not, using name is not wrong, as long as you're using XHTML 1.0, not XHTML 1.1.
  7. I can. Unless you have a few languages or a few formats to choose from, there really is no need for a starting page. You might as well use this as your top logo, but alone on a starting page? Cute, but useless.As for the image itself... I can't really give any suggestions to that either. It is like taken from the stars .
  8. If you want case sencetive search, you can just use the contains() function in an XPath expression like this: //QA[contains(.,$keyword)] where $keyword is of course the word to search for.The way with which you initiate this search would depend of your environment. In PHP for example, see the DOM functions.If you want case incencetive search, the deal is almost the same, but you'll have to translate() both of the arguments into one case.
  9. Um... Windows Media Player.Well, if you have Windows 2000, that might be it. Opera is most stable under Windows XP, even though as you can see, it runs on older versions too.
  10. Oh. You mean the "._-" in the rage selection? As far as I'm familiar with, those are just additional characters that fall into this range. This is the only place in a regular expression where the only true metacharacter is "-". But scince it's placed last, it really doesn't do anything, other then selecting a dash.So, the range [a-z0-9._-] Includes lowercase letters from "a" to "z", numbers from "0" to "9", dot, underscore and a dash.
  11. You mean if there's a way to add "amp;" without adding "amp;"? No.[edit]Oh wait, sorry. I didn't saw that first line was an edit. Please, in the future, place edits in the end. It makes more sence.[/edit]
  12. XQery sounds like the best option to me, but.. I don't think PHP has any support for it just yet. It only supports XPath 1.0 and DOM. This could be enough if you use it wisely. I personally never really thought about that, but now when I think about it... here's the logic you need to do by using PHP: Scan the directory for the targeted files. I think the scandir() function might be a good start, but I'm not sure how to filter only the XML files and/or filter those files even furher (say by directory for example). Loop through the array and load each file from it. Perform the desired XPath expression over the current file. Generate an XML (fragment) containing each result (and optionally some related data). Store the created fragment to a global newly created DOM tree and go to the next result. Each next result will be added to this DOM tree. Take the newly created DOM tree as an XML input and use an XSLT file to create the result page. Show the user the transformation. Tought? Maybe not as much as it sounds, but it's not a walk in the park... for me at least.When XPath 2.0 and XQuery 1.0 are supported in PHP, things will get easier. By using the standart doc() function, you'll be able to generate the tree without calling a new DOM instance for every document.
  13. I've seen this for various applications various amounts of times. There really isn't an effective way of fighting this. It really depends and must be investigated. I suggest you get yourself some crash logger like Inspector IIXII. There's also a guide on how to report Opera crashes using this tool.Before anything, I suggest you update your Windows to the max. This includes IE7 and WMP11, incase you don't have them yet.Also, ensure you have the latest build of Opera.
  14. Example of replace(), heh? OK. The following example will output the string with all numbers replaced by a sharp sign: <?phpprint ereg_replace("[0-9]","#","There are 6 000 000 000 people in the world. Bill Gates has $50 000 000 000, while my personal savings are only about $150.")?> The output of the above will be: There are # ### ### ### people in the world. Bill Gates has $## ### ### ###, while my personal savings are only about $###.
  15. To sum regex all up (correct me if I'm wrong)) - Group. Contains a regular expression. Useful for applying a regular expression over several characters.[] - Range. jesh gave the best example.| - "OR". Mathes either of the regular expressions around it.\ - Escape the following character(s). If used before alphanumeric character, it could indicate a special predefined match.. - Any character.* - Zero or more occurances of the previous character(s).? - Zero or one occurence of the previous character(s).+ - One or more occurances of the previous character(s).^ - Begins with the following characters.$ - Ends with the previous characters.{n} - "n" amount occureces of the previous character(s).{n,} - "n" or more occurances of the previous character(s).{,n} - Zero of up to "n" occurances of the previous character(s).{n,m} - minumum "n" occurences of up to "m" occurances of the previous character(s).As for the "/" character. It's used in Perl and JavaScript to enclose regular expressions. Why? I have no idea. I'm not experienced in either.(e|p)reg_replace() searches the third argument against a regular expression in the first argument. Each match is replaced with the string in the second argument.(preg_)?split()... I'm not sure but I think it turns a string (the second argument) into an array. Each array member is a string. The separator is selected with the regular expression (the first argument). For example, the string "12/21/2006" in (preg_)?split("\/","12/11/2006") will return an array with the following three members: 12, 21 and 2006.
  16. Try <frameset cols="121,*" style="border: none; margin: 0; padding: 0;"> [edit] No wait... that doesn't work. Hm... are you sure you have the XHTML 1.0 Frameset DTD?The reference to that DTD looks exactly like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> [/edit]
  17. By using CSS. Try <frameset cols="121,*" style="border: none;"> If that doesn't work, add this in your head element: <style type="text/css">frameset {border: none;}</style>
  18. What you write in your list doesn't have to be your knowledge, but rather what you want to see next. I'm suggesting this, because knowledge of languages changes much slower then preferences. So at one point you might want to see other people struggle with PHP, while the next time you decide you want to watch some XML action, etc.In any case, you won't be answering the next problem.
  19. Yup. It does, which is why I think the initial rules + my suggestion would be best. In any case, the topic would have to be cleaned...Post model: The first poster starts with a problem (task) to solve. At the end of his/her post, (s)he will add a language or (preferrably) a list of languages. Every next poster first MUST solve the problem at hand. After the problem is solved, that same poster MAY create a new problem. The new problem SHOULD be in the language the previous poster has specified as his/her (list of) language(s). The poster solving the issue MUST include a (list of) language(s) that (s)he would like to see as the next problem, regardless of whether (s)he created a new problem or not. Rules: No one is allowed to have two answers in a row!* Only one problem at a time. Don't post new issues before the current one is solved!** When you create a new problem, let it be only one problem, not several problems in one post. That is, one file to work on (be it with one or more mistakes in it), not several files. When the error is not in syntax, but semantics, descibe what is the code supposed to do, or give further details. It will be up to the solver to see what the code does as is and where is that semantical error.*** * In the worst case, this will make it 4 players' game.** For simpler cases, you may directly write a new problem, before the issuer has confirmed that you solved the issue. For more complicated problems, this is still optional, but highly reccomened.*** For example, ".menu:hover" and ".menuhover" are both valid CSS selectors, but they select two different things. In a case like this you could say "This is applied over this (X)HTML: <a class="menu">link</a>" or you could say "One character away from the desired mouse effect".
  20. Yup. I'm of the non-talented-in-design (NTID... huh... sounds kind'a cool ) type too.I really like the SiteProCentral tool. Imagine if any site allowed you to customize it based on preferences, scpecified with a color chooser like this one. It would be so awesome. If only that guy had a Web Service for this. I mean, image the situation: your visitor enters a color code (or name, which is in turn translated to a code) and your application sends that request to the WS. The WS returns the color pallete, which your application then uses as constants to use with the site's colors. Already sounds exciting to me. Now if only I or anyone else could pull this off.
  21. There isn't any way for your XML editor to know what your XML is. XML as you (most probably should) know doesn't have any fixed elements. You define them. That is why applications can't do anything with your XML before they know what it is and that's what different XML parsers and transformation languages are for.You may use XInclude or XLink, but in both cases, your editor might again be unable to show you the contents of the included file. If that editor has XLink and XInclude support, plus an XML parser, it might be able to do so, but it will never do it automatically.
  22. How come both of this two aren't correct? I mean, TCP/IP may have not been created, but it's still "used", right? Well, if so, then this means the above is true. If it needs any corrections, it could be
  23. Well, it really depends what you accept.Your current Schema accepts nothing or a single complete element. Scince it doesn't have anything else specified it won't match <NullableDecimalField/> nor <NullableDecimalField></NullableDecimalField> I think for both of those, you need to add nillable="true". So the line becomes <xs:element name="NullableDecimalField" nillable="true" minOccurs="0" maxOccurs="1" type="dectype"/>
  24. You can select elements by their namespace URI, by using parenthesis before the element name, in which you write the namespace URI. For example: {urn:xsd:$ahV10}AppHdr/{urn:xsd:$ahV10}From I'm not sure if this is applicable on prefixed elements though. I know it works with default namespaces (xmlns="xs:anyURI", not xmlns:prefix="anyURI"), but never tryed it with prefixes.Btw, it's useless to have a prefix if it's going to change. Choose your prefixes wisely. As far as XSLT goes though, if you're making a stylesheet for handling data that's not yours, it is a good idea to know and use the above.
×
×
  • Create New...