Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. One more thing. I currently use: if ($options) { foreach ($options as $option) { if ($option = "removeEmptyXMLNS") { $output = ereg_replace(' xmlns=""','',$transformation); //Remove the empty xmlns attributes that sometimes get created. } } //Return the transformation with options. return $output; } And it works, but it somehow seems as low performance and unstable. Is there a way to check each $option without repeating the same "if" on true? I mean, the current form allows me to add: if ($option = "removeEmptyXMLNS") { $output = ereg_replace(' xmlns=""','',$transformation); //Remove the empty xmlns attributes that sometimes get created. }elseif ($option = "whatever") { //Some action } But if there are two $option = "whatever" the option will needlessly be performed two times and scince it was already applied once, it's needless to check other $option variables for the same thing.
  2. using foreach was the first thing on my mind, but I never knew it could also assign the key name of the array to a variable. Thanks a million.
  3. OK. Let me generalize the question. How can I loop through the key names and values of an associative array and perform a certain PHP action based on each key name and value? The loop must not alone return something (the way a function does) but must rather repeat the same action in the procedure (or function) in which it's used.
  4. boen_robot

    Install Apache

    It doesn't matter. This is only information that will be shown in error messages. The email adress to contact you and the domain to tell the users which site they encountered the error on or something like that. I suggest you type in your IP in the first two fields and write an email with a fool proof spam filter in the third field.
  5. boen_robot

    Install Apache

    Simply use:http://localhostinstead of typing your IP. Using this however means that only you can view those pages.
  6. boen_robot

    scrollbar

    Who said it's going to work? I only said the main stylesheet is going to be valid. Valid doesn't mean working.And by the way, you're not using a conditional comment. Turn: <link red="stylesheet" href="iestyles.css" type="text/css" /> into <!--[if IE]><link red="stylesheet" href="iestyles.css" type="text/css" /><[endif]--> [edit] Shame on me. I should have noticed that [/edit]
  7. The site you're showing only has a logo and that's it...Well, I can't tell you how to do it in a certain language, mostly because I haven't constructed a client myself.What I can tell you though is that you can't make a static document in a simple text editor and expect it to work. You need ANY server side scripting language to create the client if you'll be using it in a web site (cause WS can be used in Desktop applications and Interactive (Flash for example) controls too). I'm not a mind reader, so I can't know for sure what (if any) server side scripting language you have at your disposal.
  8. I'm not that experienced with PHP.What I can tell you is that the actual result you see is a multidimensional array with the results you want. If the query had returned a number of elements, each element's content would have been in a different key from the array. The problem is I don't know how to deal with multidimensional arrays.Yes, Simple XML is available in PHP5 by default too, and scince this worked for your PHP4 host, I guess it works there too.
  9. boen_robot

    NameSpace

    Data Islands can't work with multydementional XMLs. They can only lock on one level and that's it. That is why your first example worked. Sea and Air are both on one level but when you added one level above, you're requring that both the inner and outer level are processed and that's something Data Islands can't do.There are so many reasons for not using them, so just don't use them. Any other method, just not this one, please.
  10. I think all of the things in the Webmaster Guidelines is useless. I mean the sentences: and say it all.Instead of giving this paper, one could easily sum all that up with:Don't create a family/individual site, unless you have something to say other then your day-to-day happenings. This not only protects your personal information, but ensures you'll be interesing to whoever reads your blog. By the way, the sentence: doesn't make any sence to me. There is either a word or some comma missing here. You should paraprase this. Possibly separate it in two sentences for clarity.I like most of the things in the collection. Didn't find as much stangenessness as with the first sheet. I think all of them should end with theese three tips: Not only the "Intelectual Property" and "Predator Tip" sheets I mean. Those three are essential to the overall computer education, so they are simply a must for everything this site has to offer.Speaking of intelectual property, I must say most people (including myself) KNOW that they are using illegal software and KNOW they are violating intelectual property rights. The only legal programs I have are some free ones and my Guild Wars game. Everything else, Dreamwaver, Office, even the OS is illegal. And I'm not afraid to say that out loud, for one very simple reason: My goverment permits using pirated software. What they don't allow is distibuting pirated software. So when I "borrow" a CD from someone, he's the one to blame. When I download a copy of Windows on my ISP's server, my ISP is the one to be blame (if ever caught) and so on. Goverment buildings are also dissallowed of using pirated software, but I'm a home user, thank you.Also, I know I'm 17, so that may sound childish coming from me, but why not tell your first (or maybe... just maybe even full) name, age and city? Those are just basic stuff, and aren't something that may be used to steal your identity. At least in my country... there's a thing called UIN (Unique Identification Number) assigned to you only, so unless the thief knows that number too, you're safe. I mean, legitimate companyes that need your UIN and name won't share it with third parties and they won't collect your adress and age, scince they can gather it with by checking up the UIN with the police. They'll check it up anyway, to ensure the UIN belongs to that person. On the other side, places that ask you for name and age won't ask you for UIN and adress, scince they shouldn't need it for whatever they're doing. That other thing is probably not going to be money related either, scince such info is easily obtainable. Other combinations are also possible, but if they are 2 on 2, it's all good. Banks are probably one of the very few organizations that ask for all of those, but they do it only for the purpose of estabilishing a legitimate account. And that's how it should be! Otherwise, identity theft would have been a breeze. And pedophiles... without the adress, they can't do anything. Knowing the city, name and age of someone is not enough to locate him/her unless it's a really small city or a village and knowing the UIN is only usefull if you are or have close contacts with a policeman. Name, age and city is all the "sacred" information I reveal about myself and fortunatly for me, Plovdiv is a big town and I'm sure there are a lot more 17 year old "Vasil"s in it.
  11. I'm not going to write such a complex stylesheet as a whole like this. Read the tutrorial and attempt to do something for yourself. When you encounter a specific thing that didn't turned out as expected, ask and then I could help you solve that particular problem.
  12. I live in a big city (the second biggest in Bulgaria) but it's just that the term "library" isn't as modernized as is in other countries. The term "library" implies ONLY a place with literature that you can rent and nothing more.What I mean is that there's no library with a site, or a library with a computer. In the best case, there'll be one for the manager to track books on. There are no... um... how should I say it... reading tables... only shelves. At least that's the situation in every library in my town that I have visited.Then again, I haven't been into a library the past 5 years, so things might have changed a bit. But they probably aren't... the key factor that's missing is "money". In order to get something from a library, you just pay a single 10 BGN (about 6 USD) registration fee and nothing more. Only overdue books are paid then on (I don't know if that's the system in other countries). Other then that, libraries are sponsored either by the goverment which prefers to give money for education then on libraries (which I think is the right choise) and by individuals that donate books. Scince stuff like "Programming" is university work for some people and a new discovery for others (like myself and everyone that has started with this the last couple of years) finding OLD books in libraries donated by anyone is impossible. Finding NEW ones in bookstores or stands is a lot easier, but as I said, bying a book for something I can learn on the internet always stops me.C(++) is probably the only language for which I don't feel this way, but with it I feel too unconfident to start. If I could only take a peek into what it can TRULY do with few lines of code, instead of getting lost in learning it for nothing, I would have changed my mind and buy a book for it.
  13. You need XSL-FO Processor. One that will either display the output in it's own environment or (as it most oftenly happens) convert it into another format (PDF mostly, but sometimes also Post Script) to display it in another environment (Adobe Acrobat Reader).One such processor is Apache FOP, but I don't know how to use it. An application that includes it is Stylus Studio. You can preview the output and even save that output there.
  14. You may simply use some of the XML functions. Either Expath, DOM or simple XML.Scince Simple XML is... well... simple, here's a sample of what might work for you: <?php$xml = simplexml_load_file("test.xml");$result = $xml->xpath("/rss/channel/abouttown:location/@city");print_r($result);?>
  15. boen_robot

    NameSpace

    What exactly do you mean by "not working"? The source tree is present when this document is opened and there is no error, meaning the document is well formed XML. What is it that is not working with you?
  16. Bla bla bla bla... I didn't understood a thing of your last two posts. But I do realize what you're aiming at anyway. Error handling, which as I mentioned is missing and it's terribly needed.Well, scince the XSLT isn't working good when only one of the parameters is present, but it works with the default values if no parameter is set, then I guess the best thing to do is a single condition to check if both parameters are present and pass both of them or neighter.Simply: if ($_GET['page'] and $_GET['photo']) {$args = array('page' => $_GET['page'], 'photo' => $_GET['photo']);} or.... um.... how exactly do to tell if two variables are present? justsomeguy... is the above correct or...?
  17. If you want to consume the other web service, you need to connect to that WSDL file with the language you'll be using to construct the web service client.You only need your own WSDL file when you create your own web service for others to use.How to build a web service or client is another question though and it varyes greatly, depending on what you'll be using to create it.
  18. I would be lucky to find even that in a library .
  19. This article shows the 4 methods of using XSLT with more then one language. Choose the one you need depending on the structure of your document. The only method I advise against using is of course the first method.
  20. The "@" selects XML attributes, not elements called "attribute" with a certain name. Try this sort of XSLT: <xsl:template match="ns_products:attributes"> <attributes> <xsl:for-each select="ns_products:attribute"> <attribute> <xsl:value-of select="." /> </attribute> <value> <xsl:value-of select="following-sibling::*[position()=1]" /> </value> </xsl:for-each> </attributes></xsl:template> This of course will only work if you want what I think you want. After all, that's not the complete SOAP envelope you're showing and I'm not sure if the output: <attributes><attribute>Speed</attribute> <value>56 MBPS</value> </attributes> <attributes><attribute>Voltage</attribute> <value>900 V</value> </attributes> Is exactly what you need, though even if that's not right, it's still more readable then the above .
  21. boen_robot

    scrollbar

    Because they are Microsoft's invention and as such, only they support it.The only way to keep your stylesheet valid and still use scrollbars is to place the scrollbars in IE only stylesheet called with another invention of Microsoft- conditional comments.
  22. I would never.... ok... maybe not never, but the fee will have to be VERY VERY large. I'm not going to say a number though, cause what I consider a high fee is a middle size project for the rest here .
  23. Tools like Stylus Studio have some sort of tools for Web Services, but in order to construct and use a Web Service for real, you need to have some sort of language to generate it. What do you have in mind?
  24. If you have MS Access (as you should in order to use ODBC on the first place) you can find the Northwid database in%Office's folder (by default that's C:\Program Files\Microsoft Office\)%\OFFICE11\SAMPLES\Northwind.mdb
  25. I don't think there is such a thing. Simply because it's not something that needed. You could construct something like this yourself by using regular expressions, but I feel it's not worth the effort.
×
×
  • Create New...