Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. Offtopic:// They seem to have a really different educational system in England. I'm 11th grade (year at school) but I'm 17 years old. The years at school are 12 => at 18, a person is considered to finish it's main education. The high education (university, college) is the only thing after.
  2. Eurika!"Add" function just implemented. The thing I was missing was the setAttribute() function. I'm still thingking on how to generate the new ID properly, and I'm up to creating a delete and edit functions, but this is still a great progress: <?php//Prepare the variables and constants$xmlFile = "photo.xml"; //Your XML file$action = $_POST["action"]; //What are we going to do with it$DBroot = "images"; //This is the element storing everything else.$DBunit = "image"; //The elements you have in the pseudo DB.//Prepare the XML file.$dom = new DomDocument;$dom->formatOutput = true;$dom->preserveWhiteSpace = true;$dom->load($xmlFile);$xpath = new DomXPath($dom);//Perform the desired actionswitch($action){ case "add": $parent_path = "/" . $DBroot; $next_path = "/" . $DBroot . "/" . $DBunit . "[position() = last() + 1]"; // Find parent node $parent = $xpath->query($parent_path); // new node will be inserted before this node $next = $xpath->query($next_path); // Create the new element $newDBunit = $dom->createElement($DBunit); //Create all of the element's attributes foreach ($_POST as $attribute => $value) { if (!empty($value) && $attribute !== "action") { $newDBunit->setAttribute($attribute,$value); } } //The new ID is the number of elements + 1. //Unfrortunatly, this doesn't cover the situation when some item is missing, but the ID must still increment. $newDBunit->setAttribute("id",$xpath->evaluate("count(//@id)") + 1); // Insert the new element and the whitespaces around it. $whiteSpaceBefore = $dom->createTextNode(" "); $whiteSpaceAfter = $dom->createTextNode("\n"); $parent->item(0)->insertBefore($whiteSpaceBefore, $next->item(0)); $parent->item(0)->insertBefore($newDBunit, $next->item(0)); $parent->item(0)->insertBefore($whiteSpaceAfter, $next->item(0)); $content = $dom->saveXML(); break; case "remove": die("REMOVE Not implemented"); break; case "edit": die("EDIT Not implemented"); break;}//Save the output and notify if there are any errors.$writingToFile = file_put_contents($xmlFile,$content);if (!$writingToFile) {die("Error writing to file");}echo "File written successfully. The new file is " . $writingToFile . " bytes large.";?>
  3. There is no way to do this with plain HTML.In the near future, when XHTML and XInclude are more supported, you'll be able to do this and it will work in all XHTML enabled browsers.For now, the only thing you can do is to use server side includes (or SSIs in short). They come in different flavors, depending on the language you choose. Be it PHP, ASP, Cold Fusion, etc.
  4. YOUR intensions might not be, but others' might be.What you see only appears when the HTML file is ran locally. It won't appear by default when the page is requrested from a web server (even if that server is on the same computer).If you want, you may somehow "inform" the user of the problem and tell them to enable JavaScript.
  5. Actually, that path should be IISs one. Apache is by default located in:C:\Program Files\Apache Software Foundation\Apache2.2unless you've specified otherwise during the installation.The documentRoot is by default the "htdocs" folder located there and the configuration file is called "httpd.conf" and it's inside the "conf" folder.No. Apache doesn't support any server side scripting language by default. It has a built in module to allow SSIs as well as some simple server side scripting functionality, but there isn't a powerful language included.
  6. You need the Win32 binary file.
  7. Well, there's the <meta http-equiv="Expires" content="day-of-the-week, day short-month full-year hours:minutes:seconds timezone" /> element. For example: <meta http-equiv="Expires" content="Sun, 12 Nov 2006 05:00:00 GMT"> This will force the browser to refetch the page if it's passed this time, but enable caching beforehand.For the JS problem, I understood it from the start, but I still can't really experience it. Note that I'm using IE7, so I have no idea if this issue occurs in IE6.You might be interested in finding yourself another host. One that would offer you free server side scirpting support.For the lists problem, you could specify another class for the first list item that would remove the border from it.
  8. If you're going to take the info and format a completely new page for printing, then it's best to use a server side scripting language. Not only it's faster and leaner, but it would also allow you to validate the data before creating the page if needed.
  9. Apache? Complicated? Now I'll never... who told you that? Apache is very simple to install and configure. Installing the additional modules you need to run is a bit harder, but once you do it, you'll understand the logic behind it and you'll see it's easy as 1,2,3. And to be able to do it the first time, there is us who can help you with that.There is one thing that Apache (or any other server!) can't run though. ASP(.NET). The reason is that it's a Microsoft thing, and as such, only Microsoft themselves support it.There are few alternatives that can run on Apache or other servers, but all of them are at least slightly different then the original. If not in terms of syntax, then in terms of processing methods, speed, etc.Cold Fusion can run on a few other servers as well. When you set it up, there should be a drop down box to list Apache, IIS and all the rest. Check those out.I'm not sure on what part of those servers can PHP run as well though. Apache remains the most worldwidely supported.
  10. Mostly, but not only that.If it's only for disabling caching, you can add this in your every page:<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" /><meta http-equiv="Pragma" content="no-cache" /> And honestly, I'm not sure of the difference between those two. I just know they should work.The other thing you could do is to set up the server to send "no-cache" HTTP headers, but you probably don't have that much control, so the above remains the easiest solution, and it's certanly better then the JS one, scince it works even with JS disabled.The other thing that I find majorly wrong is the use of tables to arrange the products. Using a floated list with fixed dimensions (to avoid browser incompatabilites) would do better, at least in terms of faster loading and lesser markup.I would also suggest using lists for the menu and remove the character separators in their favor, etc.But I guess in the end, this is a store. Not only that, but it's a store for jelewly. A jewel must be seen in order to be appreciated, so all accessability stuff is probably meaningless for this particular site. If it was a store for... say firniture... there might have been some point.As for your last problem. I can't really seem to duplicate it and my internet is not that fast, so getting only the first thumbnail being loaded isn't a problem for me.I do think that you should manually add each link. If not, create a server side script and a database that will carry each item's price, image, name (,etc.?) and listing number, from which then you'll assemble the full URL. Practically what you have right now, but being done on the server side for the sake of flexiblity. Then again, googlepages don't offer a server side scripting language, so I guess your current approach is the best option you can get. I exclude the XML client side way, because you'll have too much to learn, which you don't really need right now. Besides, I'm not sure if googlepages allow XML and XSLT files either.
  11. Simple... true. I like simple stuff actually, so I think it looks good.The code however is a total crap. A site as simple as this could easily be made with a CSS based layout without much difficulties.By the way, Ible-White is "she" as far as I'm aware of.
  12. Actually, :hover in IE7 works on all elements, not just anchors (<a>). I think :hover in IE6 also worked on <td>s.If you need "the cell to be a link", you can expand the link to fit in the dimensions of the cell. To do this, add "display:blick" as well as dimensions set to 100% to the link's properties. Like this for example: a { color: blue;background: red;display:block;height: 100%;width: 100%;}a:hover { color: red;background: blue;display:block;height: 100%;width: 100%;} P.S. The fact that you're new to a language is not an excuse not to use it. Not for CSS at least. You'll resolve to it sooner or later, believe me.
  13. I think Skemcin would love it, but still: it's too long. Try to shorten it down a bit to a line or two.
  14. You have to admint there are two differences1. The name of the second variable2. mihalism didn't forgot the ";" at the end Nevertheless, it's a total stealing ... I mean, look at me. At least I changed the question&answer moto to problem&solution one and not to mention the language used.
  15. I don't know about Cisco, but MikroTik's routers and software (that can turn any PC into a router) have their own powerful enough scripting capabilities.The best thing about those is that everything is documented. Even without classes, you may learn yourself, if you just have the testing environment. Or if you don't have time, nerves and/or resources, there's also training in MikroTik.
  16. You haven't read anything. Not in W3Schools' tutorials anyway. One of the very first examples shown is exactly the thing you need: the <xsl:for-each> element.
  17. I'm not sure I understand what you want... some samples of expected output will be good.A variable is converted to a string when used in value-of, so putting a predicate on it is really an error.To convert a variable to a node-set that you can then access, you can use the exsl:node-set() function or the msxml:node-set equivalent if you're using a Microsfot processor.
  18. I tested the first example and it worked perfectly. The only thing I did was to close the UserData element, because it was ill-forming the XML.For the second example, I think a nested choose looks better and it's also more efficient, scince once the first conditions is true, the next ones won't be checked.So what I suggest is this: <xsl:when test="@targetRefs"><xsl:choose><xsl:when test="@state='started'">...</xsl:when><xsl:if test="@state='completed'">...</xsl:when><xsl:if test="@state='pending'">...</xsl:when></xsl:choose></xsl:when> You don't have to have <xsl:otherwise> so this makes the process smoother.
  19. boen_robot

    web page

    Actually, the FTP commander is there for you to upload, rename and delete your pages, not to edit them.And you add a new page by simply uploading the file to the FTP. How to upload the file? The same way you have uploaded your existing ones.Getting a link to the new page however will requre you to manually add a link to each of the existing pages or if your server supports some sort of SSIs, use the provided method for inserting the single navigation file into all pages automatically.
  20. The first example is really weird. Are you sure the <tr> is not in some sort of for-each or anything?As for the second example, I think in your case, the best way is this: <xsl:for-each select="PLMXML/WorkflowProcess"> <tr> <xsl:for-each select="Task"> <xsl:choose> <xsl:when test="@targetRefs and @state='started'"> <!--if it has targetRefs, AND the @state is 'started' do the following--> <td><img src="blue1.jpg"></img></td> <td><font size="2" color="000000" face="arial"><xsl:value-of select="../@name"/></font></td> <td colspan="5"><hr></hr></td> </xsl:when><!--Other conditions-->... </xsl:choose></xsl:for-each></tr></xsl:for-each> For other cases, other methods might be better. It really depends on the case itself.
  21. Try this: <xsl:template match="/*[local-name()='project']"><xsl:apply-templates/></xsl:template> If that doesn't work... I don't know. Read this whole page. I've got those two tips from there.
  22. But "bad guys" don't always have guns. They sometimes have blades/showrds/knives and other "cold" weapons. The only way for a law enforcement to enforce someone is being one step ahead.The cold weapons themselves are also a technology (though primitive) which is both a cursed blessing and a blessed curse. You can use an axe to cut trees from which you'll make homes, furniture, paper, etc.; use a knive to cut animal meat more easily (we're predators... it's our nature... so what?).... or you can use all of the above to kill a man (and cut it's meat more easily... I mean, we are animals, right? ).Again, it comes up to the way the user uses the technology.
  23. Who's him? The boss, the customer... the devil?In any way, I guess you need to ask if he has a host with SSL enabled and a certificate. Also, you need to know what's the payment method that will be used. What server side scripting languages the host has. Possibly what are the products, though that's not that essential.I guess that's all. All I can think of anyway.
  24. Having a CDATA is equivalent to having an element with no childs but only text. So <used><![CDATA[<a href="link.html">link1</a>, <a href="link2.html">link2</a>]]></used> is the same as <used><a href="link.html">link1</a>, <a href="link2.html">link2</a></used> And in order to turn either into pure output with no alterations whatsoever, you must add disable-ouput-escaping="yes" to the value-of element. Not supported in Transformiix (Firefox).Example: <xsl:value-of select="used" disable-ouput-escaping="yes"/>
  25. boen_robot

    XPath question

    The contains() function maybe? <xsl:for-each select="//@title<xsl:if test="contains(., 'you')"><xsl:value-of select="."/></xsl:if>
×
×
  • Create New...