Jump to content

kvnmck18

Members
  • Posts

    365
  • Joined

  • Last visited

Everything posted by kvnmck18

  1. kvnmck18

    *.WML and *.WAV

    haha, is this to make a custom ring tone? If so, that's clever...but a much easier aproach would be to search online (try ebay first) and look for a cord that will connect from your phone to your computer by USB.Ringtones usually don't work in WAV...they are I think MP4...I might be wrong.
  2. Err. I don't know why this is still puzzling me.I need a clear head here...help ?
  3. Err. I don't know why this is still puzzling me.I need a clear head here...help ?
  4. kvnmck18

    Xsl and xml

    What about? There are no stupid questions.
  5. You can do multiple Xpaths by seperating them using "|"ex:<xsl:for-each select="parent/child | this/that">...does that help, I'm a little confused on why you are doing this if you are "new" to XML.The XML word docs are quite a lot of work and really lengthy to say the least.If I'm following you correctly, I've been wanting to do something similiar...maybe a XSLT to reform and out the XML Word Doc into a more user friendly/legiable XML doc.If I ignore the headers (examples: w:wordDocument, w:ignoreElements, o:DocumentProperties, w:fonts, ect.) and move to w:body I get a pretty nice (Still way over informed XML) XML doc. - <w:body>- <wx:sect>- <w:p wsp:rsidR="00323B96" wsp:rsidRDefault="00323B96">- <w:r> <w:t>My name is Kevin</w:t> </w:r> </w:p>- <w:p wsp:rsidR="00323B96" wsp:rsidRDefault="00323B96">- <w:r> <w:t>I like bold stuff,</w:t> </w:r>- <w:r wsp:rsidRPr="00323B96">- <w:rPr> <w:b /> </w:rPr> <w:t>see bold</w:t> </w:r>- <w:r> <w:t>.</w:t> </w:r> </w:p>- <w:sectPr wsp:rsidR="00323B96"> <w:pgSz w:w="12240" w:h="15840" /> <w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="720" w:footer="720" w:gutter="0" /> <w:cols w:space="720" /> <w:docGrid w:line-pitch="360" /> </w:sectPr> </wx:sect> </w:body> Now I can make the path for all bold with the "w:b" path being included under the w:p...whatever this probably doesn't make sense... and I'm not trying to think real hard on this right now I'm in a middle of writing a paper. <?xml version="1.0" encoding="iso-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="iso-8859-1"/><xsl:template match="wordDocument/body/sect"> <xsl:for-each select="p/r"> <xsl:value-of select="t" disable-output-escaping="yes"/> <br /> </xsl:for-each></xsl:template></xsl:stylesheet> Just add an xsl:if and it makes the Word Doc XML into legiable and you can count the number of items that are bold with an xsl:count...AND list them them out of the context....or make a search to find these values.But...I don't think this helps you really.
  6. You know what I was thinking about with a search...you recently told me that it's not possible to "highlight" text when you do an XML search. But I think I believe otherwise.I haven't tested it but I'm pretty sure it will work...Using tokenize function... tokenize("$keyword", "\s+")and so on...Does that make sense?
  7. Another thing is you can save any Word doc as an XML and from there you have your premade XML....Though it's not worth it and it's pretty messy.
  8. <?xml version="1.0" encoding="iso-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" omit-xml-declaration="yes"/> <xsl:param name="columns" select="3" /> <xsl:param name="category"/> <xsl:param name="type" /> <xsl:param name="id" /> <xsl:param name="sim" /> <xsl:param name="sort"/> <xsl:param name="pagedElement" select="'image'" /> <xsl:param name="recordsPerPage" select="2" /> <xsl:param name="totalitems" select="count(channel/item[title='Furniture']/image)"/> <xsl:param name="pages_div" select="round($totalitems div $recordsPerPage)"/> <xsl:param name="pageNumber" select="1" /><xsl:template match="channel"> <xsl:apply-templates /></xsl:template><xsl:template match="/*"> <td class="content_main"> <table cellpadding="0" cellspacing="0" class="items_table"> <xsl:call-template name="pages"/><br /> <xsl:variable name="startPoint" select="($pageNumber - 1) * $recordsPerPage" /> <xsl:for-each select="item[title='Furniture']/image[name()=$pagedElement and position()>=1+ $startPoint and position()<=$startPoint + $recordsPerPage]"> <xsl:call-template name="inside_all"/> <xsl:if test="position() mod 2 = 0"> <tr/> </xsl:if> </xsl:for-each> </table> </td></xsl:template> <xsl:template name="inside_all"> <td style="width:2px"> </td> <td class="items_td_image_all"> <a href="open.php?id={id}" class="item_link_all"> <img src="{.//@thumb}" title="Click To Open {title}" class="items_listing_thumb_all" /><xsl:if test="stock = 'Sold'"> <img src="images/item_sold_small.gif" class="item_small_SOLD"/> </xsl:if> <div class="items_td_description_all"> <b style="font-size:14px; margin-bottom:2px;"><xsl:value-of select="title" disable-output-escaping="yes"/></b> <br /> <xsl:for-each select=".//prices/price"> <xsl:variable name="tax" select=".*.0675"/> <i>$<xsl:value-of select="format-number(.+$tax, '#.##')"/></i> <xsl:value-of select="@title"/> </xsl:for-each> </div> </a> </td> </xsl:template> <xsl:template name="pages"> <xsl:value-of select="$pageNumber"/>/<xsl:value-of select="$pages_div"/> <br /> Total items: <xsl:value-of select="$totalitems"/> <br /> <xsl:if test="$pageNumber > 1"> <a href="?page={$pageNumber - 1}"> Previous </a> </xsl:if> <xsl:if test="$pageNumber < $pages_div"> <a href="?page={$pageNumber + 1}"> Next </a> </xsl:if> <br /> <xsl:variable name="startNumPoint" select="($pageNumber - 1) * $totalitems" /> <xsl:for-each select="item[title='Furniture']/image[position()>=1 and position()<=$pages_div]"> <xsl:choose> <xsl:when test="not(count(preceding-sibling::image) +1= $pageNumber)"> <a href="?page={count(preceding-sibling::image)+1}"> <xsl:value-of select="count(preceding-sibling::image) +1" /> </a> </xsl:when> <xsl:otherwise> <xsl:value-of select="count(preceding-sibling::image) +1" /> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template></xsl:stylesheet> This now works for the different "item" sections, now I need to get it to work for all then also the items. I still can't seem to get that to work. So it's kindof working but not at all...at least for what I want it to do.
  9. <?xml version="1.0" encoding="iso-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" omit-xml-declaration="yes"/> <xsl:param name="columns" select="3" /> <xsl:param name="category"/> <xsl:param name="type" /> <xsl:param name="id" /> <xsl:param name="sim" /> <xsl:param name="sort"/> <xsl:param name="pagedElement" select="'image'" /> <xsl:param name="recordsPerPage" select="12" /> <xsl:param name="totalitems" select="count(channel/item/image)"/> <xsl:param name="pages_div" select="round($totalitems div $recordsPerPage)"/> <xsl:param name="pageNumber" select="1" /><xsl:template match="channel"> <xsl:apply-templates /></xsl:template><xsl:template match="/*"> <td class="content_main"> <table cellpadding="0" cellspacing="0" class="items_table"> <xsl:call-template name="pages"/><br /> <xsl:variable name="startPoint" select="($pageNumber - 1) * $recordsPerPage" /> <xsl:for-each select="item/image[name()=$pagedElement and position()>=1+ $startPoint and position()<=$startPoint + $recordsPerPage]"> <xsl:sort select="id" order="descending"/> <xsl:call-template name="inside_all"/> <xsl:if test="position() mod 2 = 0"> <tr/> </xsl:if> </xsl:for-each> </table> </td></xsl:template> <xsl:template name="inside_all"> <td style="width:2px"> </td> <td class="items_td_image_all"> <a href="open.php?id={id}" class="item_link_all"> <img src="{.//@thumb}" title="Click To Open {title}" class="items_listing_thumb_all" /><xsl:if test="stock = 'Sold'"> <img src="images/item_sold_small.gif" class="item_small_SOLD"/> </xsl:if> <div class="items_td_description_all"> <b style="font-size:14px; margin-bottom:2px;"><xsl:value-of select="title" disable-output-escaping="yes"/></b> <br /> <xsl:for-each select=".//prices/price"> <xsl:variable name="tax" select=".*.0675"/> <i>$<xsl:value-of select="format-number(.+$tax, '#.##')"/></i> <xsl:value-of select="@title"/> </xsl:for-each> </div> </a> </td> </xsl:template> <xsl:template name="pages"> <xsl:value-of select="$pageNumber"/>/<xsl:value-of select="$pages_div"/> <br /> Total items: <xsl:value-of select="$totalitems"/> <br /> <xsl:if test="$pageNumber > 1"> <a href="?page={$pageNumber - 1}"> Previous </a> </xsl:if> <xsl:if test="$pageNumber < $pages_div"> <a href="?page={$pageNumber + 1}"> Next </a> </xsl:if> <br /> <xsl:for-each select="*[*[name() = $pagedElement and position() <= $pages_div]]"> <xsl:choose> <xsl:when test="not(count(preceding-sibling::*) +1= $pageNumber)"> <a href="?page={count(preceding-sibling::*)+1}"> <xsl:value-of select="count(preceding-sibling::*) +1" /> </a> </xsl:when> <xsl:otherwise> <xsl:value-of select="count(preceding-sibling::*) +1" /> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template> It's just the path. Its bothering me so much. The "page numbers" with this are jsut 1-4 which 1-4 comes from the four sections(4 different "item"). What I want is the total count of the "image" that are in the items...but errr. God, I don't know why I can't get this... it's just a simple path problem.This one:<xsl:for-each select="item/image[name()=$pagedElement and position()>=1+ $startPoint and position()<=$startPoint + $recordsPerPage]">and <xsl:for-each select="*[*[name() = $pagedElement and position() <= $pages_div]]">The XML is like an RSS (really simplified showing of the setup below)<channel><item><image></image><image></image><image></image><image></image></item><item><image></image><image></image><image></image><image></image></item><item><image></image><image></image><image></image><image></image></item></channel>
  10. <?xml version="1.0" encoding="iso-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" omit-xml-declaration="yes"/> <xsl:param name="columns" select="3" /> <xsl:param name="category"/> <xsl:param name="type" /> <xsl:param name="id" /> <xsl:param name="pagedElement" select="'image'" /> <xsl:param name="recordsPerPage" select="6" /> <xsl:param name="totalitems" select="count(channel/item/image)"/> <xsl:param name="pages_div" select="round($totalitems div $recordsPerPage)"/> <xsl:param name="pageNumber" select="1" /><xsl:template match="channel"> <xsl:apply-templates /></xsl:template><xsl:template match="/*"> <td class="content_main"> <table cellpadding="0" cellspacing="0" class="items_table"> <xsl:call-template name="pages"/><br /> <xsl:variable name="startPoint" select="($pageNumber - 1) * $recordsPerPage" /> <xsl:for-each select="item/*[name()=$pagedElement and position()>=1+ $startPoint and position()<=$startPoint + $recordsPerPage]"> <xsl:call-template name="inside_all"/> <xsl:if test="position() mod 2 = 0"> <tr/> </xsl:if> </xsl:for-each> </table> </td></xsl:template> <xsl:template name="inside_all"> <td style="width:2px"> </td> <td class="items_td_image_all"> <a href="open.php?id={id}" class="item_link_all"> <img src="{.//@thumb}" title="Click To Open {title}" class="items_listing_thumb_all" /><xsl:if test="stock = 'Sold'"> <img src="images/item_sold_small.gif" class="item_small_SOLD"/> </xsl:if> <div class="items_td_description_all"> <b style="font-size:14px; margin-bottom:2px;"><xsl:value-of select="title" disable-output-escaping="yes"/></b> <br /> <xsl:for-each select=".//prices/price"> <xsl:variable name="tax" select=".*.0675"/> <i>$<xsl:value-of select="format-number(.+$tax, '#.##')"/></i> <xsl:value-of select="@title"/> </xsl:for-each> </div> </a> </td> </xsl:template> <xsl:template name="pages"> <xsl:value-of select="$pageNumber"/>/<xsl:value-of select="$pages_div"/> <br /> Total items: <xsl:value-of select="$totalitems"/> <br /> <xsl:if test="$pageNumber > 1"> <a href="?page={$pageNumber - 1}"> Previous </a> </xsl:if> <xsl:if test="$pageNumber < $pages_div"> <a href="?page={$pageNumber + 1}"> Next </a> </xsl:if> <br /> <xsl:for-each select="//*[name() = $pagedElement and position() <= $pages_div]"> <xsl:choose> <xsl:when test="not(count(preceding-sibling::*) +1= $pageNumber)"> <a href="?page={count(preceding-sibling::*)+1}"> <xsl:value-of select="count(preceding-sibling::*) +1" /> </a> </xsl:when> <xsl:otherwise> <xsl:value-of select="count(preceding-sibling::*) +1" /> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template></xsl:stylesheet> It's something wrong with my xpath... the numbers keep looping and they start on 4 not one...hmmmI tried a bunch of logical paths and none worked.ANy ideas?I know it's small to fix this.
  11. kvnmck18

    xml recursive search

    Wow, I like this rahn. boen - did I heard php4?hahaGod, I need to stop being so worthless.
  12. Not to sound rude, try to make some code...then post it...THEN everyone can help you out. ...it can be just scratch or a start just try something.
  13. kvnmck18

    PHP Mail Form

    Oh. My bad.Thank you.
  14. kvnmck18

    PHP Mail Form

    <?php$to .= $_POST['mine'];$subject .= $_POST['subject'];$message .= $_POST['html'];$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= $_POST['email'] . "\r\n";$headers .= 'From:' . $_POST['name'] .'<'.$_POST['mine'].'>' . "\r\n";$send = mail($to,$subject,$message,$headers);if($send){print "Success!";print "<br />";print "<center>";print "<a href=\"here.php\">Return</a>";print "</center>";}?> How change the SMTP port? I want to make it more friendly so it's not always spam.
  15. kvnmck18

    watermark

    Do you mean not allowing it to be copied?
  16. Yeah, I don't get it...when ever I though any options with xsl:sort it doesn't work. But it's not an error...it's weird. Real weird. Any other sugguestions?
  17. I have tried the name() fnc and it didn't help that.boen-Gobby sounds badass. Great greatThe choose I think is the way to go...but for some reason it's not working. I might be doing something small that messed it up. I'm going to look at it again.And...I re-wrote the "recordsPerPage" XSLT to make it shorter and more simple and to function for my XML at hand... I think that to is also something small to fix.The search...I don't care to highlight them I just want a list. I will come back to the search after the other two problem are fixed.I'm going to work around with this...if I don't solve those two by the end of the day I'll post what I have.
  18. I'm updating my website with all my art on it, I'm running into troubles with some stuff I'm tryign to get to work...HOPE YOU ALL CAN HELP!I am trying to make a sort for a page and it's not working... ...I am currently using a param (<xsl:param name="sort"/>)...and I'm using PHP (4)... It is being applied to a template in the xsl:sort (<xsl:sort select="$sort"/>)...but this does not seem to work because when a param passes it's like saying this:<xsl:sort select="'title'"/>...have the double quotes makes it not work.I then tried using a choose for this... like this: <xsl:choose><xsl:when test="$sort = 'title'><xsl:sort select="title"/></xsl:when><xsl:otherwise><xsl:sort select="id"/></xsl:otherwise></xsl:choose> ...but this does not work either...hmmm... any ideas??ALSO! I am trying to limit the amount of nodes per page...I want to limit to 6 items...How should I go about this... count()?Then divide the count() of all by 6...then make the php create the amount of page#'s?...I'm not sure on that really.LAST BUT NOT LEAST:I'm coming back to my orginal thoughts on the XML search:http://w3schools.invisionzone.com/index.ph...2&hl=search...my XML is set up like an RSS feed (not used as an RSS just because I like the setup, and saying that makes you all understand how it's set up).I want the search just to search ANY WORD or ANY PART OF ANY WORD found ANY WHERE in the XML.Then post results.THANK YOU,Kevin
  19. This works: <?php$xmlFile = "xml.xml";$xsltFile = "xsl.xsl";$args = array("category" => $_GET['category'], "type" => $_GET['type'], "localLinkAfter" => "&type=". $_GET['type'], "id" => $_GET['id'], "localLinkAfter" => "&id=". $_GET['id']);$engine = xslt_create();$output = xslt_process($engine, $xmlFile, $xsltFile, NULL, NULL, $args);print $output;xslt_free($engine);?> I had this originally...but with one minor typo.I hate typos, makes you question everything.
  20. <?php$xmlFile = "xml.xml";$xsltFile = "xsl.xsl";$args = array("category" => $_GET['category'], "type" => $_GET['type'], "localLinkAfter" => "&type=". $_GET['type']);$engine = xslt_create();$output = xslt_process($engine, $xmlFile, $xsltFile, NULL, NULL, $args);print $output;xslt_free($engine);?> This only works for passing two params to the XSLT, anyone know how to get the third one to work?
  21. Goooooood stuff. God, I've been so busy lately.
  22. Cool cool. You forgot one thing (and so did I but I caught it):This needed a minor adjustment: <xsl:param name="totalRecords" select="count(//*[name()=$pagedElement])"/> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" omit-xml-declaration="yes"/> <xsl:param name="category"/> <xsl:param name="pageNumber" select="1" /> <xsl:param name="recordsPerPage" select="1" /> <xsl:param name="pagedElement" select="'image'" /> <xsl:param name="totalRecords" select="count(//*[name()=$pagedElement])"/> <xsl:param name="totalPages" select="round($totalRecords div $recordsPerPage)"/> <xsl:param name="disablePaginationNavigationControls" /> <xsl:param name="disablePaginationNavigationPrevious" /> <xsl:param name="disablePaginationNavigationControl" /> <xsl:param name="disablePaginationNavigationNext" /> <xsl:param name="localLinkBefore" select="'?n='"/> <xsl:param name="localLinkAfter" /> <xsl:template match="/"> <html> <head> <style type="text/css"> .paginationNavigation, .paginationNavigation ul {text-align: center; margin: 0 auto; padding: 0;} .paginationNavigation ul, .paginationNavigation ul li {display: inline;} .paginationNavigation span, .paginationNavigation a {padding: 10px;} </style> </head> <body> <xsl:apply-templates /> </body> </html> </xsl:template> <xsl:template match="/*"> <xsl:choose> <xsl:when test="//*[name()=$pagedElement]"> <dl> <xsl:variable name="startPoint" select="($pageNumber - 1) * $recordsPerPage" /> <xsl:for-each select="//*[name()=$pagedElement and position()>=1+ $startPoint and position()<=$startPoint + $recordsPerPage]"> <xsl:call-template name="pagedElement" /> </xsl:for-each> </dl> <xsl:if test="$disablePaginationNavigationControls = false()"> <xsl:call-template name="paginationNavigation"/> </xsl:if> </xsl:when> <xsl:otherwise> <h1>Error. No items paged.</h1> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="pagedElement"> <img src="{large}" title="{description}"/> </xsl:template> <xsl:template name="paginationNavigation"> <div class="paginationNavigation"> <xsl:call-template name="previous" /> <xsl:call-template name="paginationNavigationControl" /> <xsl:call-template name="next" /> </div> </xsl:template> <xsl:template name="previous"> <xsl:if test="$disablePaginationNavigationPrevious = false()"> <xsl:if test="$pageNumber > 1"> <a href="{$localLinkBefore}{$pageNumber - 1}{$localLinkAfter}">Previous</a> </xsl:if> </xsl:if> </xsl:template> <xsl:template name="paginationNavigationControl"> <xsl:if test="$disablePaginationNavigationControl = false()"> <ul> <xsl:for-each select="//*[name()=$pagedElement and position() <= $totalPages and boolean(@type = $category or not($category))]"> <xsl:variable name="pageNumberControl" select="count(preceding-sibling::*)+1" /> <li> <xsl:choose><xsl:when test="not($pageNumberControl = $pageNumber)"><a href="{$localLinkBefore}{$pageNumberControl}{$localLinkAfter}"><img src="{url}" title="{title}"/></a></xsl:when> <xsl:otherwise> <span> X </span> </xsl:otherwise> </xsl:choose> </li> </xsl:for-each> </ul> </xsl:if> </xsl:template> <xsl:template name="next"> <xsl:if test="$disablePaginationNavigationNext = false()"> <xsl:if test="$pageNumber < $totalPages"> <a href="{$localLinkBefore}{$pageNumber + 1}{$localLinkAfter}">Next</a> </xsl:if> </xsl:if> </xsl:template></xsl:stylesheet> Oh, and that image[1] does not work here... I'm not really sure how to make that work. Unless it was another choose with a when "n" is null make it be *[image[1]] (or something like that). The image[1]/ brings up no value
  23. You (boen_robot) helped me make this... along time ago and it worked but it was in use with a differently formatted XML(<images> <image src="image.jpg" description="Whatever blah" /></images>)I changed a little: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" omit-xml-declaration="yes"/> <xsl:param name="category"/> <xsl:param name="pageNumber" select="1" /> <xsl:param name="recordsPerPage" select="1" /> <xsl:param name="pagedElement" select="'item'" /> <xsl:param name="totalRecords" select="count(/*/*[name()=$pagedElement])"/> <xsl:param name="totalPages" select="round($totalRecords div $recordsPerPage)"/> <xsl:param name="disablePaginationNavigationControls" /> <xsl:param name="disablePaginationNavigationPrevious" /> <xsl:param name="disablePaginationNavigationControl" /> <xsl:param name="disablePaginationNavigationNext" /> <xsl:param name="localLinkBefore" select="'?n='"/> <xsl:param name="localLinkAfter" /> <xsl:template match="channel"> <html> <head> <style type="text/css"> .paginationNavigation, .paginationNavigation ul {text-align: center; margin: 0 auto; padding: 0;} .paginationNavigation ul, .paginationNavigation ul li {display: inline;} .paginationNavigation span, .paginationNavigation a {padding: 10px;} </style> </head> <body> <xsl:apply-templates /> </body> </html> </xsl:template> <xsl:template match="/*"> <xsl:choose> <xsl:when test="*[name()=$pagedElement]"> <dl> <xsl:variable name="startPoint" select="($pageNumber - 1) * $recordsPerPage" /> <xsl:for-each select="*[name()=$pagedElement and position()>=1+ $startPoint and position()<=$startPoint + $recordsPerPage]"> <xsl:call-template name="pagedElement" /> </xsl:for-each> </dl> <xsl:if test="$disablePaginationNavigationControls = false()"> <xsl:call-template name="paginationNavigation"/> </xsl:if> </xsl:when> <xsl:otherwise> <h1>Error. No items paged.</h1> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template name="pagedElement"> <img src="{large}" title="{description}"/> </xsl:template> <xsl:template name="paginationNavigation"> <div class="paginationNavigation"> <xsl:call-template name="previous" /> <xsl:call-template name="paginationNavigationControl" /> <xsl:call-template name="next" /> </div> </xsl:template> <xsl:template name="previous"> <xsl:if test="$disablePaginationNavigationPrevious = false()"> <xsl:if test="$pageNumber > 1"> <a href="{$localLinkBefore}{$pageNumber - 1}{$localLinkAfter}">Previous</a> </xsl:if> </xsl:if> </xsl:template> <xsl:template name="paginationNavigationControl"> <xsl:if test="$disablePaginationNavigationControl = false()"> <ul> <xsl:for-each select="*[name()=$pagedElement and position() <= $totalPages and boolean(@type = $category or not($category))]"> <xsl:variable name="pageNumberControl" select="count(preceding-sibling::*)+1" /> <li> <xsl:choose><xsl:when test="not($pageNumberControl = $pageNumber)"><a href="{$localLinkBefore}{$pageNumberControl}{$localLinkAfter}"><img src="{url}" title="{title}"/></a></xsl:when> <xsl:otherwise> <span> X </span> </xsl:otherwise> </xsl:choose> </li> </xsl:for-each> </ul> </xsl:if> </xsl:template> <xsl:template name="next"> <xsl:if test="$disablePaginationNavigationNext = false()"> <xsl:if test="$pageNumber < $totalPages"> <a href="{$localLinkBefore}{$pageNumber + 1}{$localLinkAfter}">Next</a> </xsl:if> </xsl:if> </xsl:template></xsl:stylesheet> That makes the output with an <img src="" title="Description from the first Item's Description"/> and also the "X"...but nothing else.All it need to be is to follow the path of channel/item[title]/image and list the "url"s in the img attribute and then the "large" in the main opened image.As for the for-each there is one...it's the * path.I know you know this, boen_robot...You are the god of it, don't forget.
  24. This just might be a typo...but I think it's a path problem, which I can't seem to figure out (possibly because I'm so tired)...I've used these codes before but my XML was in a different format...It's an image gallery...when thumbnail is clicked it opens as the big image...it has navigation controls (previous and next) and selects between different categories.the xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" omit-xml-declaration="yes"/> <xsl:param name="category"/> <xsl:param name="pageNumber" select="1" /> <xsl:param name="recordsPerPage" select="1" /> <xsl:param name="pagedElement" select="'image'" /> <xsl:param name="totalRecords" select="count(/*/*[name()=$pagedElement])"/> <xsl:param name="totalPages" select="round($totalRecords div $recordsPerPage)"/> <xsl:param name="disablePaginationNavigationControls" /> <xsl:param name="disablePaginationNavigationPrevious" /> <xsl:param name="disablePaginationNavigationControl" /> <xsl:param name="disablePaginationNavigationNext" /> <xsl:param name="localLinkBefore" select="'?n='"/> <xsl:param name="localLinkAfter" /> <xsl:template match="channel/item"> <html> <head> <style type="text/css"> .paginationNavigation, .paginationNavigation ul {text-align: center; margin: 0 auto; padding: 0;} .paginationNavigation ul, .paginationNavigation ul li {display: inline;} .paginationNavigation span, .paginationNavigation a {padding: 10px;} </style> </head> <body> <xsl:apply-templates /> </body> </html> </xsl:template> <xsl:template match="/*"> <xsl:choose> <xsl:when test="*[name()=$pagedElement]"> <dl> <xsl:variable name="startPoint" select="($pageNumber - 1) * $recordsPerPage" /> <xsl:for-each select="*[name()=$pagedElement and position()>=1+ $startPoint and position()<=$startPoint + $recordsPerPage]"> <xsl:call-template name="pagedElement" /> </xsl:for-each> </dl> <xsl:if test="$disablePaginationNavigationControls = false()"> <xsl:call-template name="paginationNavigation"/> </xsl:if> </xsl:when> <xsl:otherwise> <h1>Error. No items paged.</h1> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template name="pagedElement"> <img src="{large}" title="{description}"/> </xsl:template> <xsl:template name="paginationNavigation"> <div class="paginationNavigation"> <xsl:call-template name="previous" /> <xsl:call-template name="paginationNavigationControl" /> <xsl:call-template name="next" /> </div> </xsl:template> <xsl:template name="previous"> <xsl:if test="$disablePaginationNavigationPrevious = false()"> <xsl:if test="$pageNumber > 1"> <a href="{$localLinkBefore}{$pageNumber - 1}{$localLinkAfter}">Previous</a> </xsl:if> </xsl:if> </xsl:template> <xsl:template name="paginationNavigationControl"> <xsl:if test="$disablePaginationNavigationControl = false()"> <ul> <xsl:for-each select="*[name()=$pagedElement and position() <= $totalPages and boolean(@type = $category or not($category))]"> <xsl:variable name="pageNumberControl" select="count(preceding-sibling::*)+1" /> <li> <xsl:choose><xsl:when test="not($pageNumberControl = $pageNumber)"><a href="{$localLinkBefore}{$pageNumberControl}{$localLinkAfter}"><img src="{url}" title="{title}"/></a></xsl:when> <xsl:otherwise> <span> X </span> </xsl:otherwise> </xsl:choose> </li> </xsl:for-each> </ul> </xsl:if> </xsl:template> <xsl:template name="next"> <xsl:if test="$disablePaginationNavigationNext = false()"> <xsl:if test="$pageNumber < $totalPages"> <a href="{$localLinkBefore}{$pageNumber + 1}{$localLinkAfter}">Next</a> </xsl:if> </xsl:if> </xsl:template></xsl:stylesheet> the php: <?php$pageNumber = $_GET['n'];$xmlFile = "xml.xml";$xsltFile = "xsl.xsl";if (ereg("^[1-9]*[0-9]*$", $pageNumber)) {$args = array("pageNumber" => $pageNumber, "category" => $_GET['category'], "localLinkAfter" => "&category=". $_GET['category']);}$engine = xslt_create();$output = xslt_process($engine, $xmlFile, $xsltFile, NULL, NULL, $args);print $output;xslt_free($engine);?> (how I have the xml set up)xml.xml: <channel><item><title>This is A Category</title><image type="Type A"><url>images/shows/tn_image.JPG</url><large>images/image.JPG</large><title>The Title</title><description>Description</description></image><image type="Type B"><url>images/shows/tn_image2.JPG</url><large>images/image2.JPG</large><title>The Title2</title><description>Description2</description></image></item><item><title>Another Category</title><image type="Type A"><url>images/shows/tn_imagex.JPG</url><large>images/imagex.JPG</large><title>The Title X</title><description>Description of X</description></image><image type="Type B"><url>images/shows/tn_image2y.JPG</url><large>images/image2y.JPG</large><title>The Title YY</title><description>Description of Y</description></image></item></channel>
×
×
  • Create New...