Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by layton

  1. How would I go about preserving paragraphs or line breaks? I can't always control the information contained within an xml node. If somebody inputs two paragraphs in a text node, it would be good to treat it as two paragraphs and not one big one.I've tried wrapping the content in CDATA and using display-output-escaping="yes" but that isn't supported by firefox and I'm looking for a cross-browser solution.I understand that doing server-side transformations may be a good way to go, but unfortunately I don't have access to a dynamic environment. Anything that I do has to be client-side.I don't think the kind of text is really out of scope for xml and there has to be a way of achieving this.Any thoughts would be appreciated.
  2. Will RSS really handle what I'm after? To me, it looks like RSS would be able to link to pages with copy, but what about having an article itself contain links and images. Maybe I'm explaining it poorly. Basically I want my xml to look something like the following and then display it somehow. It has to be possible, I just don't know how to correctly do it.<article><title>Some random title</title><content>Some random content with a <a href="http://nowhere.com">link</a> and an <img src="Image" /> followed by more random text, links and images...maybe</content></article>
  3. I'm sure this has been asked a few times but I'm not quite sure the correct search terms.I'm wanting to be able to supply news articles via xml. Sometimes these news articles contain images or links to other places. What would be the correct way of going about this. Sometimes there's multiple links within paragraphs of articles. I'm not sure how to format it.
  4. Hrm - that's a interesting thought. I could try that. That's basically the theory I was going for but didn't know how to do it. Normally in a loop in a coding environment like JS or PHP, I'm able to open a tag (<div>) and then after my count reaches what i want, I can close it (</div>). XSL just throws an error because the first tag isn't closed right away.
  5. The example shows how to do it with a table, using tr, td and the like. I'm looking for a way that doesn't use tables. I can't seem to open a tag, run a loop and run checks, then close the loop when the checks meet the requirements. I just get an error from the browser that it expected a closing tag. I guess I could always go back to tables for this one thing, but I'd rather not.
  6. I know that title sounds a little confusing but I can't think of a proper way of naming it. Here's what I'm looking for and I can't seem to figure out a way to do it.I have an xml document that has say 20 nodes with various sub-nodes. As it stands - I have a a loop that will display all of them vertically, but I'm looking for a way to list them horizontally and then limiting it to 5 items per row. So within the loop I need to be able to tell if it's the fifth node for that row and if so, create a new row.the layout would look something like the following, where each [x] is a separate node.[x] [x] [x] [x] [x][x] [x] [x] [x] [x][x] [x] [x]what I have so far is this: <xsl:for-each select="team/member[type='member']"> <div class="pfdiv"> <a href="{pfinderURL}"><img src="{imageURL}" /></a> <h4><xsl:value-of select="name" /></h4> <xsl:value-of select="mtitle" /> </div> </xsl:for-each>
  7. I know this sounds like a dumb thing to do but in this situation there really isn't other options other than javascript, but I'm trying to stick with full css if possible.Basically I want to show or hide a <div> on a mouseclick or rollover but by using inline styles.I'm coding for a portal environment so anything outside of the body tag gets stripped and then everything within the body tag gets placed into "channels".Any help would be appreciated. Even a simple "not possible" comment.
  8. layton


    I've been reading up on XQuery and it seems like a pretty interesting thing to use but I can't seem to figure out how to use it.Where do the scripts get entered. In html? In xml? Do I need a server that supports it like I do for sql?
  9. layton

    SQL > PHP > HTML?

    yep....saw that and wrote the edit on my post.....must have wrote the edit as you were responding. got it all taken care of now.....pretty sweet. Thanks a lot sir.
  10. layton

    SQL > PHP > HTML?

    that makes sense....except to my knowledge the script im using doesn't create a file to open...i'm usinghttp://www.tgreer.com/class_http_php.htmlwhat i do is supply a url. it scrapes it and echo's back the contents. now i see that all i need to do is take the data and instead of echo back just put it into a new document.htmlunless your saying i should create the document.html manually and then fopen it?EDIT: ok i see that fopen will create the file if it doesn't exist. so pretty much i fopen, fwrite....thanks alot!!
  11. layton

    SQL > PHP > HTML?

    do you have experience with this? i downloaded a screen scrape script...which does grab the html code. so now how to i tell the script to save that information into an html document?
  12. layton

    SQL > PHP > HTML?

    Judging by the topic description you're probably thinking "well yeah!!" but here's the deal.At my place of employment, for whatever reason, the IT department has decided to not support any dynamic content or database services. I CAN, however, setup a localhost sql server and get php going on my machine as well. What i'm looking to do is make a glorified status page on jobs that i have to do. The idea is to use php / sql to input jobs and their status via form....and later change that information based on completion. The downside is that for my boss to see this data it needs to be on our test or live servers that don't support sql / php. So the question is. Is there a way to pull the data with php from my localhost and convert it an html file.
  13. layton


    ok i fixed the problem. there were 2 issues.1) i skipped over a number in the array. like 10. go figure.2) i started it with 1 instead of 0.making those two changes solved the problem.
  14. layton


    I'm having a problem getting reverse() to reverse correctly. As it stands I have an array with 21 members. when I use reverse() on the array, at spots 10 and 21 they are placed at the bottom rather than in their normal order. I was under the assumption that reverse() is supposed to reverse the order, not rearrange the order.here's the code: function myJobs(dateIn,task,url,dateOut){this.dateIn = dateIn;this.task = task;this.url = url;this.dateOut = dateOut;}theJobs = new Array();theJobs[01] = new myJobs("06.26.06","task1","my.url","06.26.06");theJobs[02] = new myJobs("06.26.06","task2","my.url","06.26.06");......theJobs[21] = new myJobs("06.26.06","task21","my.url","06.26.06"); further down i open a table, loop through the array, then close the table. here's the loop: for(i in theJobs){document.write('<tr><td>'+theJobs[i].dateIn+'</td><td>'+theJobs[i].task+'</td><td>'+theJobs[i].url+'</a> </td><td>'+theJobs[i].dateOut+'</td></tr>');} the idea behind this is to sort everything by date. newest date first. it's a glorified honey-do list. LOL. since i'm constantly adding new entries....it seems like a good idea to just reverse the order....but that's the problem. If there is a way better way to do this.....by all means...tell me. I'm not an expert.
  15. is what i want to do even possible? i can't imagine not being able to use a "hyperlink" with xml.
  16. yeah but all that's going to do is print:<a href="THELINK.COM">click here!</a>rather than provide a link.
  17. I don't understand how to use XLink to create a hyperlink on a single word. Example: <news><topic>the topic</topic><body>heres some information about our topic. for more, click here.</body></news> i've read a few tutorials on xlink and they show how to take a whole node and make it a link...but nothing is clear on making a single word in that node a link.in the example above i would like the word "here" at the end to link to an external url. i've read a little on xpointer and thought maybe that's what i need to use also....but i'm just not sure. any help would be appreciated.
  18. well i think i figured it out ..... sort of....putting the xml file on a web server (as you suggested in a round about way) displays the xml file correctly.....as far as allowing active files to run locally......apparantly my companies IT (computer police) department has removed that option completely from my system. (this option is on my work PC while the Safari issue was on my home mac....for clarity)
  19. thanks for the tip....would the security setting be the same issue if internet explorer prompts me for a download when trying to view xml or not.....i'll post this issue in another topic as to not get "off topic" as well but....for some reason....i can see the tutorial xml files fine in IE but when i create them locally it prompts for a file download instead.Cheers
  20. I was following the tutorials on XML / XSLT and when previewing the final document (http://www.w3schools.com/xsl/cdcatalog_with_xsl.xml) it appeared correctly....however when copying it directly to my own pages....and testing it....nothing showed up. So I searched to see if Safari supported it....and it's supposed to fully support XSLT. After looking at my code and double checking to see if it was me, I decided to download Camino instead and try that.....works perfectly....so my question is....how do I get it to display properly in Safari? Anyway...here's the code....seems basic enough.The XML <?xml version="1.0" encoding="iso-8859-1"?><?xml-stylesheet type="text/xsl" href="msgBoard.xsl"?><msgboard><message><topic>My XML message board topic</topic><content>My XML content for when the messages are displayed.</content></message><message><topic>The second topic for the msg board</topic><content>I'm trying to find a way to deliver the message board in a better way.</content></message></msgboard> The XSL <?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="/"> <html> <body> <table border="1"> <xsl:for-each select="msgboard/message"> <tr> <td><xsl:value-of select="topic"/></td> <td><xsl:value-of select="content"/></td> </tr> </xsl:for-each> </table> </body> </html></xsl:template></xsl:stylesheet>
  • Create New...