Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. On the first reading, it seems as you need some sort of a complex XSLT key but as this article suggests, you might also be able to achive this with a few conditions. You can add a few conditions in the same test like this for example:<xsl:if test="role1 = role2 and role4 = role5">And you can even add more weird conditions by using the boolean() function:<xsl:if test="role1 = role2 and boolean(role4 = role5 or role6 = role7)">I still don't completely grasp the test you need to make, but I'm sure it's doable with XSLT. Either conditions or keys. Good luck with the keys though. I'm not into them much yet.
  2. What about this example? Isn't it informative enough?
  3. The only thing I can add is that scince you need both parameters as mentioned, you donn't need the ifs. Only the gets. So remove the whole: if ($_GET['photo']) {$expression= array("photo" => $_GET['photo']);} $args = $expression;if ($_GET['page']) {$expression= array("page" => $_GET['page']);}else {$expression=NULL;} and replace it with what justsomeguy already suggested. That is what I was trying to say in the other topic btw.
  4. Damn it... why do the best reported issues have to be the most complicated?XSLT keys are probably the only thing I'm not that familiar with yet and this problem happens to requre it. Drat, drat, and double drat...Well, at least I could point you to this site. They have some interesting articles about XSLT, some of which also discuss keys (and which I'm reading right now, trying to figure keys out btw). Some of them might adress what you need.][edit]This page demonstrates 4 methods of grouping. I think they'll be of most use for you[/edit]
  5. Well, you can check the $_POST or $_GET value of the form element. And to select the proper element, you need to give it a name. For details, look into the W3Schools' PHP tutorial.
  6. Both the template based introduction (suggested at first by yours truly) is available as it was already mentioned, AND the question about when you started has also been discussed many times. I don't know about the rest, but I'm tired of repeating the same story over and over again . Some day, I'm going to write a biography and just reply with a link to it whenever asked a similar question .Here's an example of such topic:http://w3schools.invisionzone.com/index.php?showtopic=6287
  7. boen_robot

    NameSpace

    Namespaces using prefixes can only be declared in the root element. Infact, I'm wondering how the first example worked, as it declares a prefix in the child of a root node.So, to declare multiple prefixes, you'll use the root element, like this: <power xmlns:g="http://www.omg.com" xmlns:e="http://www.bom.com"> <g:unit> <g:sea>battleship</g:sea> <e:land> <e:grass>soldier</e:grass> <e:platoo>flame gas</e:platoo> </e:land> <g:air>stealth bomber</g:air> </g:unit></power> Your particular example may also use non-prefixed namespaces like this: <power> <unit xmlns="http://www.omg.com"> <sea>battleship</sea> <land xmlns="http://www.bom.com"> <grass>soldier</grass> <platoo>flame gas</platoo> </land> <air>stealth bomber</air> </unit></power> Non-prefixed namespaces apply the namespace on the element they are applied on and all descendant nodes that don't use another namespace.
  8. boen_robot

    css table

    I don't see the point. Tables are defined with (X)HTML... what do you have in mind for CSS? Any graphics to illustrate this?
  9. Xercec2-j is an XML parser for JAVA. There's also JAXP from Sun themselves. This few pages article discusses different JAVA parsers. It's probably good to read as it discusses good pointers such as the Performance of each one.
  10. If that document is only a static document, then don't.Otherwise, it depends on the language you'll be using. For ASP, read the W3Schools tutorial. For PHP... I don't know of a tutorial and I can't make myself a web service, but you can at least look at the SOAP functions for reference.If you use Cold Fusion or JRun, you'll be most happy. Both the consumation aspect and the publishing aspect are covered in this part of the Cold Fusion manual and this two part article for JRun. If you just use Adobe's search box with the term "Web Services" you'll also find how to do this in their other applications (I going to love Adobe for this...).
  11. I think that Opera can, but only as inline styles. It has a buggy behaviour otherwise. See this article on quirksmode.org for details.
  12. I use PHP5's XSLT processor (libxslt) very often, so I decided to build a function for it.Here's what I have until now: <?php//Define a function and it's arguments.function xsltProcessor($xmlFile,$xsltFile,$parameters,$options){ //Prepare the XML file. $xml = new DomDocument; $xml->load($xmlFile); //Prepare the XSLT file. $xsl = new DomDocument; $xsl->load($xsltFile); //Load the XSLT processor. $processor = new Xsltprocessor; $processor->importStylesheet($xsl); //Assign the paramets' values to the proper parameters. function xsltProcessorParameters($value,$key) { return $processor->setParameter(NULL, $key, $value); } array_walk($parameters,"xsltProcessorParameters"); //Execute the transformation. $transformation = $processor->transformToXml($xml); //Check the output. if ($options) { foreach ($options as $option) { if ($option = "removeEmptyXMLNS") { //Remove the empty xmlns attributes that sometimes get created. $output = ereg_replace(' xmlns=""','',$transformation); } } //Return the transformation with options. $result = $output; }else { //Return the transformation without options. $result = $transformation; }return $result;}echo xsltProcessor("test.xml","test.xsl",NULL,NULL);?> It works with any XML and XSLT file, but it has one major problem. Very often I need to pass parameters to the stylesheet before the transformation. I have the third argument set up for that, but it's not working. It's supposed to be an associative array who's keys represent the parameter names and who's values represent the parameter's value. What I have attempted for it are the lines: //Assign the paramets' values to the proper parameters. function xsltProcessorParameters($value,$key) { return $processor->setParameter(NULL, $key, $value); } array_walk($parameters,"xsltProcessorParameters"); Which I created thanks to the W3Schools PHP reference. When the function is called without the third argument, it works, but with this argument, not only the parameter is not passed, but the complete output is a blank screen. As if there's a critical error in PHP script itself. Example of a call that fails: echo xsltProcessor("test.xml","test.xsl",array("parameter1"=>"value1"),NULL); I tryed removing the "return" but that doesn't work either.
  13. What language will you be using to get the data? What do you have at your disposal? JavaScript only? Or is there a server side scripting language too? If there is, what is it? PHP, ASP.NET, Cold Fusion, JSP...?By the way, your document isn't a valid RSS document, though it is a well-formed XML one.
  14. You can also have a second value at background-position but it must be in the same declaration. That second value could be "left", "right", "top" or "bottom". The first two declare position by x and the other two by y. "center" is common for both x and y.Some valid examples are: background-position: right bottom; background-position: top center; background-position: right top; background-position: left center;
  15. Specifying both parameters in the href works. I tryed this with my own XSLT processor: <xsl:for-each select="//image[@cat=$page]"><a href="?photo={@id}&page={@cat}"> <img src="{@thumb}" id="imgthumbs"/></a></xsl:for-each> of course it has bad error handling when one of the parameters is not present, but I guess your users won't care for that much.If that doesn't work for you, then the problem is with the PHP for sure.I'm not that experienced with PHP, but I think this is how you declare two members of an array: $expression = array("photo" => $_GET['photo'], "page" => $_GET['page']); infact, you don't need the $expression variable and the line: $args = $expression; You can just use $args = array("photo" => $_GET['photo'], "page" => $_GET['page']); By the way... do you know the greatest benefit that XSLT brings? It's portability. It can work the same in all languages that have an XSLT processor. So, you should increase the role of XSLT so that the only thing left for PHP would be initiating the XSLT processor with the proper parameters. Rewritting that sort of code from PHP4 to PHP5 (or any other server side scripting language on that matter) would be a breeze.
  16. boen_robot

    html page

    For the third error, add a table cell into the row. In other words: <tr bgcolor="#6997ff"><td></td></tr> The two other errors might get fixed if those rows happen to be empty as well.If that doesn't work, use CSS to specify the height. If you don't know how.... well... let's say you don't need validation if you're using tables anyway.
  17. It seems to me as if this syntax doesn't allow the <mail> element. As if it doesn't allow you to control exactly that.If it's not that, then I don't have the slightest idea... I don't think anyone here knows plesk's scripting syntax.
  18. I'm not sure, but I think the PHP might be the cause for this one. I mean... setting up the two parameters should have worked. Try making: if ($_GET['page']) {$expression= array("page" => $_GET['page']);} into if ($_GET['page']) {$expression= array("page" => $_GET['page']);}else {$expression=NULL;} or perhaps remove the else {$expression=NULL;} from if ($_GET['photo']) {$expression= array("photo" => $_GET['photo']);} else {$expression=NULL;} After all, "NULL" resets the whole array as far as I'm aware.You seriosly need to think about moving on to PHP5 and libxslt. With it, setting a parameter is as easy as: $xslt->setParameter(NULL, 'ParameterName', 'ParameterValue'); and repeating this twice sets two parameters and so on. Not to mention that libxslt has 99% XSLT 1.0 support and a variety of EXSLT extensions too.
  19. boen_robot

    xml to excel

    In Excel, select:Data>XML>Import...and select all of the XMLs you want to import.If you want to make such thing automatically, you need to use a PHP script of some sort. I have no idea how this script will look though.There is another way too, but it's actually harder then to look for a pure PHP solution. You can combine all of your XMLs into one XML that will use the syntax that Excel understands. If that XML is opened in IE, it will result in Excel being opened in a frame. However, such XML looks pretty complex. Here's the minimal amount of code it must contain: <?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Author>Your username</Author> <LastAuthor>Your username</LastAuthor> <Created>2006-10-06T20:17:55Z</Created> <Company>Your company</Company> <Version>11.8036</Version> </DocumentProperties> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>12915</WindowHeight> <WindowWidth>15180</WindowWidth> <WindowTopX>480</WindowTopX> <WindowTopY>30</WindowTopY> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Bottom"/> <Borders/> <Font x:CharSet="204"/> <Interior/> <NumberFormat/> <Protection/> </Style> </Styles> <Worksheet ss:Name="Sheet1"> <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> <Selected/> <Panes> <Pane> <Number>3</Number> <ActiveRow>39</ActiveRow> <ActiveCol>6</ActiveCol> </Pane> </Panes> <ProtectObjects>False</ProtectObjects> <ProtectScenarios>False</ProtectScenarios> </WorksheetOptions> </Worksheet></Workbook>
  20. It's currently more of a hobby, but I already had one professional appointment too. Once I estabilish few layouts and templates, or better yet: make my own CMS, I might doing stuff professionally on regular times. And clients... I will have many once I start advertising. I work with my dad at a PC Accemblying shop. We also have corporate clients that are just begging for low cost web sites. And who better to make them, then people like ourselves that have grown with computers?
  21. What exactly is the problem?
  22. Unfortunatly, no. Look for some forum specialized in JSP. I mean... I don't think there are people here that are using it.
  23. The problem is that you are generating <asp:*> elements for the XSLT output without later parsing this output with ASP.NET. Such elements aren't supposed to be rendered by the browser, but only by the server.In order to solve the problem, you need some sort of command that will take the output and evaluate it as if it's a server side scripting code.
  24. Hm. After your PM with the link, I think I'm able to see the problem. I think the best solution is to generate the whole: <a href="?page={@cat}&photo={@id}"><img src="{@thumb}" id="imgthumbs"/></a> with condtions in the attribute. To put it in code, something like this: <a><xsl:attribute name="href"><xsl:if test="$category != 'Weddings'">?page=<xsl:value-of select="@cat"/>&amp;</xsl:if>photo={@id}</xsl:attribute><img src="{@thumb}" id="imgthumbs"/></a>
  25. I understand the idea, but I'm unable to visualize the problem. Do you have some sort of testing page to which you could link to?
×
×
  • Create New...