Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. boen_robot

    XSL:FO

    It depends on whether this content is a complete element or content of an element. If it's an element (or attribute on that matter) it's easy: <xsl:param name="searchedElement" /><xsl:template match="*[name()=$searchedElement]"><strong><xsl:apply-templates/></strong></xsl:template><xsl:template match="/"><html><body><xsl:apply-templates/></body></html></xsl:template> Where the $searchedElement parameter is edited outside the XSLT with a server side scripting language.But if you want to look for a prase inside an element or an attribute, the things get harder. The idea of an XSLT search engine sounds good though, so I'll try looking deeper some time soon.[edit] Here's some XPath expression I "invented" some time ago and just noticed it. I haven't tested it yet, but it might do the trick: <xsl:value-of select="//*[contains(text(),$SearchString)]" /> [/edit]P.S. In this example I've used XML-to-XHTML example as this is what I'm used to. If you want the results in XSL-FO, just rename the proper elements.
  2. Simple enough, scince both XMLs have the same type of structure... <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <firma> <xsl:apply-templates/> </firma> </xsl:template> <xsl:template match="/firma"> <xsl:copy-of select="."/> <xsl:copy-of select="document('xml2.xml')/firma"/> </xsl:template></xsl:stylesheet>
  3. Sorting, as it's name implies is there for sorting and you're talking about repositioning.I was just about to ask if you knew the <xsl:sort>'s attributes, but I see you do. So what I can say is that it's impossible without handlining each element separately. I can't figure the exact code right now, but I'm sure it's going to be complicated....
  4. Yes! W3Schools has upgraded to IPB 2.1.7 .
  5. In case you didn't noticed, the forum was hacked. It got back and a back-up was used to restore the forum to it's previous state. This backup is from july 8 so all posts and topics after that are lost.
  6. As I said just before the backup *blush*, here are some new IE issues posted by yours truly for which I would like to see your votes and comments about:Customizeable RSS readerJavaScript inside CSS (the greatest security flaw) It's still there damn it!
  7. It wasn't us who were hacked for us to change the passwords. IPB uses password encryption so even if the hackers got aload of the SQL database, they wouldn't know the passwords unless they really wanted to hack into some member's account after looong decryption.Besides, as far as I understood from aspnetguy's forum, the flaw they used to hack the forum is about the forgotten password thing. It allowed them to create their own passwords without knowing the password of the admin's account, allowing themselves admin access to the forum. But even with this admin rights, they are not allowed to view passwords. They are allowed to change account passwords without notifications, thus blocking them, but even then, they don't know our old ones.Nevertheless, it's good to change passwords if you could. What I'm saying is that it's not needed in this case.
  8. Could it be that you set the alignment to "justify"? Aftrer all "justify" means that text will be placed from the edges to the center, so the word "bad" could look like: b a d and longer words like "expert" could look like: e x p e r t
  9. Whoa. I left the forum for just a few minutes, and now it's back with the backup .Hope now W3Schools may at least try to fix those security vulnerabilities and/or upgrade IPB.
  10. Weren't you suppose to change the * into a current()? I'm actually wondering if what I'm looking at above (the XSLT link) is the latest XSLT. I haven't noticed any change .[edit] Oh... for starters... try to change: <xsl:variable name="total" select="round(count(*[name() = $element]) div 5) + 1" /> to <xsl:variable name="total" select="count(/dataset/item) div $recordsPerPage"/> If that works, I'll try to generalize the template.[/edit]
  11. Well, even if it is, it's blocked . If it's IRC, well... I personally hate IRC not only of it's BIG security gaps, but also for it's complex interface and command lines.
  12. An XPath expression. Read the XPath tutorial and you'll have a lot better understanding of those expressions.By the way, in the case you describe, you might as well use simply <xsl:apply-templates/> without any select statement. Or at least I think you could.
  13. The exact same output behaves differently? In IE too? I mean, if IE was the only browser to render it properly, then the problem is the MIME type but if IE is making problems too, I don't know for sure...what's the code anyway?
  14. I can steal W3Schools' content without them putting it in text files or any other downloadable form. All I need is an XML file with an XSLT stylesheet attached to it that would fetch the data for me with the document() function. Scince there are plans for making document() a built in XPath function, we would be able to that with simple JavaScript or (in the worse case) PHP. The only thing that stops me and everyone else is their conciense.
  15. Is there actually a problem here? What are you worried about? You're safe, right?
  16. My signature tells it... XSLT. But I also love all other XML based languages, as long as I can think of at least one use case for them (cause I also happen to know crappy (custom) XML based languages).
  17. boen_robot

    XML Search

    It depends on many factors... What language do you use to make the search? What do you do with the result? What part of the XML must be searched for? (Specific) Elements, (specific) attributes, (specific) strings, everything? And possibly few other things I can't think of right now.The easiest and most universal way that is yet to come would be XQuery. It's simmilar to SQL commands that are suppose to query massive amounts of data and put them in a single result set.If you would use the result set in XSLT, then perhaps a recursive XPath expression might do a better job. Something like: <xsl:value-of select="//*[contains(text(),$SearchString)]" /> Note: I haven't tested this one. it might not work, but you get the general idea.
  18. You are right about one thing... it's a silly idea. I don't think W3Schools would ever agree on a tutorial for that scince not only is not a language, but it's not even connected with internet in any kind. Even this "distributing something for the web" would still mean you only use the web for distributing, not actually doing something with it as all the things in W3Schools teach us.
  19. boen_robot

    Blank screen

    Read the FAQ at the download page of the PHP connector. According to it:
  20. Well, you could do the processing in PHP and include the result in the HTML. Let's say this is the HTML with the PHP include: <html><head>...</head><body>...<?php include("XSLT1Processor.php"); ?><?php include("XSLT2Processor.php"); ?>...</body></html> Where the XSLT#Processor.php files contain something like: <?php$xml = new DomDocument;$xml->load('data.xml');$xsl = new DomDocument;$xsl->load('one.xsl');$xslt = new Xsltprocessor;$xslt->importStylesheet($xsl);$transformation = $xslt->transformToXml($xml);echo $transformation;?> Note: The XSLT extension MUST be enabled on PHP for this to work.
  21. boen_robot

    Blank screen

    Theese are only tests here though, but I'll keep that in mind.@scott100 your code works, but what it uses is MySQL. What about MySQLi? That is what I initially wanted . Oh well, MySQL would do the job too in the meantime.
  22. boen_robot

    Blank screen

    I fixed the XSLT issue. The problem was that I accidently renamed the XML file to text.xml instead of the correct test.xml.Now to double check the MySQL spelling. That might be the problem there too.[edit] It doesn't work. I didn't noticed any errors. Here's the source of the MySQL test I use: <?php$mysqli = new mysqli('localhost','root','admin');$mysqli->select_db('demo');$result = $mysqli->query("SELECT * FROM members");while($row = $result->fetch_assoc()) { print $row['firstName'] . ' ' . $row['lastName'] . '<br/>'; }$result->close();?> Where the database "demo" and the table "members" with all of it's stuff was previously created in MySQL's command line interface. Here's a shot of the CMD:P.S. I'm not afraid to reveal my password scince it's not the one I intend to use permanently and you won't be able to access the DB anyway. I've disabled remote access.
  23. boen_robot

    Blank screen

    I recently had to reinstall the server of my friend and install everything all over again.I installed Apache, added a few settings to the configuration file to run PHP and copyed the php5ts.dll to it's proper destination. Apache and PHP work like a charm. So far so good. I now wanted to add MySQL and XSLT support. Until few minutes I was getting errors with every PHP that was using extensions, until I added the PHPiniDir directive. Now, with phpinfo() I can see the extensions are avaiable and installed properly. I even tryed enabling additional one, and saw it right after the change. Everything seems perfect, except... Now that I run a file that uses extension, I get a blank screen instead of an error message or the proper result. The source code of the output I get is this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><META http-equiv=Content-Type content="text/html; charset=windows-1251"></HEAD><BODY></BODY></HTML> And what I have added in Apache's configuration to enable PHP is this: ScriptAlias /php/ "d:/php/"AddType application/x-httpd-php .phpAction application/x-httpd-php "/php/php-cgi.exe"LoadModule php5_module "d:/php/php5apache2_2.dll"SetEnv PHPRC "d:/php"PHPiniDir "D:/php" The extension_dir directive in php.ini is set properly like this: extension_dir = "D:\PHP\ext" And phpinfo() does detect enabling and disabling changes, that is, it shows which extensions are suppose to be avaiable, so what could be the problem?Oh and, the source of the XSLT extension test: <?php$xml = new DomDocument;$xml->load('test.xml');$xsl = new DomDocument;$xsl->load('test.xsl');$xslt = new Xsltprocessor;$xslt->importStylesheet($xsl);$transformation = $xslt->transformToXml($xml);echo $transformation;?> Where of course, test.xml and test.xsl exist in the same folder and are well formed XML documents that should output proper stuff.I would have guessed it's some sort of misconfiguration if there were error messages (as before I added the PHPiniDir) but blank screen ?I can't stop asking myself how did I enabled XSLT support the first time. If that works, MySQL should too.P.S. I'm using Windows XP SP2, Apache 2.2.2, PHP 5.2.0 and MySQL 5.0.1. I had to reinstall Windows, because the HDD was placed on another PC, resulting in a... how you say... driver incompatability I think. We had to place that HDD elswhere. On that other mainboard it made the server crash whenever someone requests a file larger then 200KBs. If any additional info is requred, please do tell. Infact, here's a shot of the phpinfo().
  24. Isn't incrementing in PHP something like $i++?I mean, whatever are you trying to do, it's a PHP problem, not an XQuery one.Oh and "WTF" means "What The F*ck".
  25. Please. Let us not turn this topic to "Outlook Express- Do or not" or something like that.My point was that there's always Outlook Express existing but I do realize your concerns and I totally agree with them. As I said myself Do you have a POP3 mail is another question though. If you ask me, Outlook Express sucks, Outlook rules (my own personal opinion, please post your attacks against it elsewhere).By the way, GMail has POP3 support .
×
×
  • Create New...