Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by ATM

  1. Hey,I am trying to make an xsl stylesheet to process wikipedia text.for example <body>[[public transport]]</body>would be transformed into<body><a>public transport</a><body>I know I could do this in a number of different languages, but I would really like to do it in xsl for specific reasons.I have tried using transform function but have only been able to transform one character into another character, for example[[ into aaand the output is not as xml or html just raw text.Can anyone help me with this.Kind regardsRyan
  2. Hey,How do I enter standards mode in IE using an xml or xsl file?So that margin:auto; works?Thank you.
  3. ATM

    Center Align Layout

    Hey,This css is not working in IEI'm trying to center align a div on the page the css is div.page {background-color:#FFFFFF;border-color:#DDDDDD;border-style:solid;border-width:1px;height:auto;margin-left:auto;margin-right:auto;width:700px;} This div is directly inside the body.The url is http://development.rymax.co.uk/eacb/products.xmlandhttp://development.rymax.co.uk/eacb/products.xslThank you,
  4. I fixed it, If anyone is having the same problem all I did was move the javascipt to an external file.
  5. Hello,I'm using two pages one xml and one xsl, I just though I would mention it as that might be something to do with the problem, but I highly doubt it. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>******</title><style type="text/css">div.active {display:block;}div.back {border-bottom-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;color:#333333;cursor:pointer;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;font-weight:700;height:25px;line-height:25px;overflow:hidden;padding-left:20px;width:100%;}div.banner {border-bottom-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;height:100px;width:100%;}div.content {border-bottom-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;height:440px;width:100%;}div.feature {color:#333333;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;margin-left:10px;padding:5px;width:100%;}div.footer {height:30px;width:100%;}div.hidden {display:none;}div.information {background-color:#FFFFFF;border-color:#CCCCCC;border-style:solid;border-width:1px;height:400px;margin-left:240px;margin-top:20px;overflow-x:hidden;overflow-y:auto;position:absolute;width:440px;}div.item {border-bottom-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;color:#333333;cursor:pointer;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;height:25px;line-height:25px;overflow:hidden;padding-left:20px;width:100%;}div.logo {border-bottom-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;height:100px;width:100%;}div.menu {border-bottom-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;height:30px;width:100%;}div.navigation {background-color:#FFFFFF;border-color:#CCCCCC;border-style:solid;border-width:1px;height:400px;margin-left:20px;margin-top:20px;overflow:hidden;position:absolute;width:200px;}div.page {background-color:#FFFFFF;border-color:#CCCCCC;border-style:solid;border-width:1px;height:auto;margin-left:auto;margin-right:auto;width:700px;}div.title {border-bottom-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;color:#333333;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;font-weight:700;height:25px;line-height:25px;overflow:hidden;padding-left:20px;width:100%;}</style><script type="text/javascript"><![CDATA[function hide(product){ var elements = document.getElementsByTagName('div'); for (var i = 0; i < elements.length; i++) { if (elements[i].className == 'active') { elements[i].className='hidden'; } } document.getElementById(product).className='active';}]]></script></head><body><div class="page"> <div class="logo"> </div> <div class="menu"> </div> <div class="banner"> </div> <div class="content"> <div class="navigation"> <div id="categories"> <div class="title"> Categories </div> <xsl:for-each select="root/category"> <xsl:variable name="category" select="@name" /> <div class="item" onclick="document.getElementById('{$category}').style.display='block';document.getElementById('categories').style.display='none';"> <xsl:value-of select="@name"/> </div> </xsl:for-each> </div> <xsl:for-each select="root/category"> <xsl:variable name="category" select="@name" /> <div class="hidden" id="{$category}"> <div class="title"> <xsl:value-of select="@name"/> </div> <xsl:for-each select="manufacturer"> <xsl:variable name="manufacturer" select="@name" /> <div class="item" onclick="document.getElementById('{$category}/{$manufacturer}').style.display='block';document.getElementById('{$category}').style.display='none';"> <xsl:value-of select="@name"/> </div> </xsl:for-each> <div class="back" onclick="document.getElementById('{$category}').style.display='none';document.getElementById('categories').style.display='block';"> Back </div> </div> </xsl:for-each> <xsl:for-each select="root/category"> <xsl:variable name="category" select="@name" /> <xsl:for-each select="manufacturer"> <xsl:variable name="manufacturer" select="@name" /> <div class="hidden" id="{$category}/{$manufacturer}"> <div class="title"> <xsl:value-of select="@name"/> </div> <xsl:for-each select="product"> <xsl:variable name="product" select="@name" /> <div class="item" onclick="hide('{$product}');"> <xsl:value-of select="@name"/> </div> </xsl:for-each> <div class="back" onclick="document.getElementById('{$category}/{$manufacturer}').style.display='none';document.getElementById('{$category}').style.display='block';"> Back </div> </div> </xsl:for-each> </xsl:for-each> </div> <div class="information"> <xsl:for-each select="root/category/manufacturer/product"> <xsl:variable name="name" select="@name" /> <xsl:variable name="image" select="image" /> <div class="hidden" id="{$name}"> <div class="title"> <xsl:value-of select="@name" /> </div> <xsl:for-each select="feature"> <div class="feature"> <xsl:value-of select="@information" /> </div> </xsl:for-each> </div> </xsl:for-each> </div> </div> <div class="footer"> </div></div></body></html></xsl:template></xsl:stylesheet> <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="products.xsl"?><root> <category name="Camcorders"> <manufacturer name="Canon"> <product name="Elura 100"> <model>Elura 100</model> <image>media/graphics/Elura-100.jpg</image> <feature information="Widescreen HR Recording"></feature> <feature information="Optical Performance You Can See"></feature> <feature information="Brilliant Video"></feature> <feature information="Stunning Digital Photography"></feature> <feature information="Perfect Exposures"></feature> <feature information="Share Your Video"></feature> <feature information="Share Your Photos"></feature> </product> </manufacturer> <manufacturer name="JVC"> <product name="Everio GZ-MC500"> <model>Everio GZ-MC500</model> <image>media/graphics/Everio-GZ-MC500.jpg</image> <feature information="Microdrive format lets you shoot up to 60 minutes of high-quality MPEG-2 video"></feature> <feature information="10x optical zoom"></feature> <feature information="1.8-inch LCD monitor"></feature> <feature information="Create and share DVDs easily with included software"></feature> </product> </manufacturer> <manufacturer name="Panasonic"> <product name="AG-HVX200"> <model>AG-HVX200</model> <image>media/graphics/AG-HVX200.jpg</image> <feature information="Camcorder Type Digital"></feature> <feature information="Recording Format Mini DV"></feature> <feature information="Recording System NTSC / PAL"></feature> <feature information="CCD Quantity 3"></feature> <feature information="Optical Zoom 13x"></feature> </product> </manufacturer> <manufacturer name="Sony"> <product name="DCR-DVD408"> <model>DCR-DVD408</model> <image>media/graphics/DCR-DVD408.jpg</image> <feature information="2.1-megapixel ClearVid CMOS sensor"></feature> <feature information="Carl Zeiss Vario- Sonnar T* lens; 10x optical/80x digital zoom"></feature> <feature information="Dolby Digital 5.1-channel recording; built-in microphone"></feature> <feature information="2.7-inch widescreen touch-panel Clear Photo plus LCD"></feature> <feature information="DVD-R/RW/+RW/+R DL compatible"></feature> </product> </manufacturer> </category> <category name="Car Electronics & GPS"> <manufacturer name="Alpine"> </manufacturer> <manufacturer name="Clarion"> </manufacturer> <manufacturer name="Garmin"> </manufacturer> <manufacturer name="Kenwood"> </manufacturer> <manufacturer name="Pioneer"> </manufacturer> <manufacturer name="TomTom"> </manufacturer> </category> <category name="Cell Phones & PDA"> <manufacturer name="LG"> </manufacturer> <manufacturer name="Motorola"> </manufacturer> <manufacturer name="Nokia"> </manufacturer> <manufacturer name="PDA"> </manufacturer> <manufacturer name="Sony Ericsson"> </manufacturer> </category> <category name="Digital Cameras"> <manufacturer name="Canon"> </manufacturer> <manufacturer name="Nikon"> </manufacturer> <manufacturer name="Olympus"> </manufacturer> <manufacturer name="Panasonic"> </manufacturer> <manufacturer name="Sony"> </manufacturer> </category> <category name="LCD/Plasma TV"> <manufacturer name="Fujitsu"> </manufacturer> <manufacturer name="Panasonic"> </manufacturer> <manufacturer name="Pioneer"> </manufacturer> <manufacturer name="Samsung"> </manufacturer> <manufacturer name="Sony"> </manufacturer> <manufacturer name="Toshiba"> </manufacturer> </category> <category name="Multimedia Players"> <manufacturer name="Apple"> </manufacturer> <manufacturer name="DVD players"> </manufacturer> <manufacturer name="Other"> </manufacturer> </category> <category name="Notebooks/Laptops"> <manufacturer name="Apple"> </manufacturer> <manufacturer name="Hewlett Packard"> </manufacturer> <manufacturer name="Sony"> </manufacturer> <manufacturer name="Toshiba"> </manufacturer> <manufacturer name="Acer"> </manufacturer> </category> <category name="Video Games"> <manufacturer name="Microsoft"> </manufacturer> <manufacturer name="Nintendo"> </manufacturer> <manufacturer name="Sony"> </manufacturer> </category> </root> Below is the javascript. <script type="text/javascript"><![CDATA[function hide(product){ var elements = document.getElementsByTagName('div'); for (var i = 0; i < elements.length; i++) { if (elements[i].className == 'active') { elements[i].className='hidden'; } } document.getElementById(product).className='active';}]]></script> This is what calls the function:<div class="item" onclick="hide('{$product}');">IE returns two errors; once the page has loaded it says expected ')' and on clicking a product which triggers the hide function, it says object expected.Sorry for the long code but I have spent many hours on this.Thank you.
  6. couldn't you have an if statement through the functionsomething along the lines of this var status=1;function something(){if (status==2){//code ...........}} then when you want it enabled status=2;
  7. Hey,I would like to position an div element at the bottom right of a text area.I would also like it so that whatever the width or height of the text area the div will always be over the bottom right cornerThe code would be like this: <div class="container"><textarea></textarea><div class="overtextarea"></div></div> Thanks,
  8. ATM

    style to scrollbar

    To be fair no-one will think any different of your site.It will be the same as every other site.But if you insist on changing it, you could develop one using javascript.
  9. ATM

    im having truble

    you have to use background-position to position the image where you want it.
  10. Sorry, I didn't really understand you, but I think this will help what your trying to do.View the properties to the image and look at its height and width.Then base the size of the div on the width and height of the image.I think this topic should be in CSS well as long as your using CSS to set the size of the div.
  11. I think its margin-left:auto;margin-right:auto;and shouldn't it be<div style="text-align:center;">rather than<div class="centre">
  12. Make Love, Not Warcraft.Perhaps make a unique script to display an object, or start developing for silverlight?Although I hate Microsoft, Silverlight looks quite good.
  13. .image {background-image:url(image.gif);background-repeat:repeat-x;background-position:100px 100px;}I think thats right.Actually I'm not to sure whether it will repeat both sides of the positioning.I don't think It will work now.You could just use a different div as the background.
  14. ATM

    Links in CSS

    You could do it in Javascript.You might be able to use the content:; in CSS, but I don't think its supported by IE.
  15. Hello,I have have a div; <div style="overflow:auto;"></div>When I have some text that overflows the div and has a hyphen (-) in it Internet Explorer starts a new line.for exampleif the text was: 'Hello-Dave' and it overflowed IE would show'Hello-Dave'Anyone know how to solve this?Thank you.
  16. It has to be on the same server as ajax sends requests to the server and you can't send requests to other peoples server.Well I don't think you can.
  17. Take a look its not a image, well the middle one is.
  18. http://particletree.com/examples/lightbox/theres are loads of extensions on the inter net just search google.
  19. Hello,Basically, I use Ajax to get the contents of the file; navigation.phpnavigation.php requires some Javascript in the head section, and since navigation.php is requested using ajax it doesn't have a head section.Also the file which has the Ajax can't have the Javascript in the head section because It won't be able to affect the requested data as the data is received after the page is loaded.any suggestions?Thank You.
  20. Hey,I need to make a script that uses the php ftp functions to work out whether the items in my array from ftp_nlist are files or directories.I have tried if (ftp_size($connection, $file) == -1) { echo '' . $file . '<br /> <br />'; } but I don't think the server supports ftp_size as it gives all of the sized of files as the error; -1.So if you could help me out I would greatly appreciate it.Thank you.
  21. ATM

    Parsing XML

    HelloI was wondering if someone could give me the code to parse an XML document in PHP4 and display all of the tags except the root tags as well as the text they contain so it could be processed in a way similar to the way bellow:foreach($tag){echo $tagecho ":";echo $contents }I would also want it to process only tags with in certain other tags for example:<page 1><title>page 1</title></page 1><page 2><title>Page 2</title></page 2>I would only want it to display tags in certain pages.I'm sorry if this seems a large task to do, but I have tried and failed many times using PHP4 and I just can't do it.Thank you.
  22. Sorry, I don't really understand what you need help with, please could you make it a little bit more clearer what you are trying to do, thank you.
  23. Hello,please may someone help me to load any xml file into a form using php 4.For example if I had an xml file with<letters><letter>a</letter><letter>b</letter><letter>c</letter></letters>on it.I would want an html form to appear like this:-LETTERS-letter:[ a ]letter:[ b ]letter:[ c ]I would prefer this to use the foreach command and it must work with any XML file and must work with php 4.Thank you.
  • Create New...