Jump to content

rvdokkum

Members
  • Content Count

    14
  • Joined

  • Last visited

Community Reputation

0 Neutral

About rvdokkum

  • Rank
    Newbie

Contact Methods

  • Website URL
    http://www.bluenoise.nl
  • ICQ
    0

Profile Information

  • Location
    Amsterdam
  1. no longer need to change te header of the xml.after switching to server side parsing of the xslt. using php.
  2. i target cross browser and cross platform.i get no error instead nothing is rendered by the xslt. where i expect my result it is empty.i will resolve the firefox bug later when i switch to server side parsing of the xslt.
  3. in my xml data there is a node containing the embed script for a video playerhow do i put this into my xsl filexml part with ''video-player'' <post><video-player><span id="video_player_6108595387">[<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">Flash 10</a> is required to watch video.]</span><script type="text/javascript">renderVideo("video_player_6108595387",'http://mydomain.tumblr.com/video_file/6108595387/tumblr_lm64ngkwu81qjb4vj',400,225,'poster=http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lm64ngkwu81qjb4vj_frame1.jpg,http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lm64ngkwu81qjb4vj_frame2.jpg,http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lm64ngkwu81qjb4vj_frame3.jpg,http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lm64ngkwu81qjb4vj_frame4.jpg,http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lm64ngkwu81qjb4vj_frame5.jpg')</script></video-player> my xsl failed attempt to use the ''video-player'': <div><xsl:value-of select="video-player" disable-output-escaping="yes"/></div> using the node with the ''audio-player'' works finexml part with audio player: <audio-player><embed type="application/x-shockwave-flash" src="http://assets.tumblr.com/swf/audio_player.swf?audio_file=http://www.tumblr.com/audio_file/5046352702/tumblr_lkffpeQVub1qjb4vj&color=FFFFFF" height="27" width="207" quality="best"></embed></audio-player> xsl using ''audio-player'' <div><xsl:value-of select="audio-player" disable-output-escaping="yes"/></div>
  4. how do i use the replace function to delete <p> and </p> at the end of the variable $long_audio_caption?part of my xsl code:<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <h2>Blog</h2> <table> <xsl:for-each select="tumblr/posts/post"> <tr> <td> <xsl:choose> <xsl:when test="@type='audio'"> <xsl:text>audio node</xsl:text> <xsl:variable name="long_audio_caption"> <xsl:value-of select="audio-caption"/> </xsl:variable> <xsl:copy-of select="$long_audio_caption" /> for now i use this workaround : http://geekswithblogs.net/Erik/archive/200.../01/120915.aspx
  5. Do all latest browsers on mac an windows support XSLT 2?http://www.w3schools.com/XSL/xsl_browsers.asp
  6. if i change the versions of xml and xsl to 2.0 then i can use the replace function to delete the <p> an </p>fn:replace(string,pattern,replace) - http://www.w3schools.com/Xpath/xpath_functions.aspwill the latest browsers on mac and windows support xml xsl v2?
  7. thanks for the info.i added the required info to original post.there is nothing that can be done about the xml data. thats how tumblr generates it.
  8. when using <xsl:value-of select="audio-caption"/>how do i get the text without the <p> </p>adding /p did not work : <xsl:value-of select="audio-caption/p"/>example of similar full xml file : http://staff.tumblr.com/api/readpart of my xml: <?xml version="1.0" encoding="UTF-8"?>......<post><audio-caption><p>Test audio post of a ringtone.</p></audio-caption> part of my xsl: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <h2>Blog</h2> <table> <xsl:for-each select="tumblr/posts/post"> <tr> <td> <xsl:choose> <xsl:when test="@type='audio'"> <xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="@url"/> </xsl:attribute> <xsl:value-of select="audio-caption"/> </xsl:element>
  9. thanksi see i also got my quotes messed up at the end of audio'all working
  10. i like to test the value of an attributehow do i check if the value of attribute type="audio"this is what my xml looks like <tumblr><posts><post type="audio"><audio-caption>.... this i my attempt that is not working <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <h2>Blog</h2> <table> <xsl:for-each select="tumblr/posts/post"> <tr> <td> <xsl:if test="tumblr/posts/post/@type='audio'"> <xsl:text>audio node</xsl:text> </xsl:if> </td> </tr> </xsl:for-each> </table></xsl:template></xsl:stylesheet>
  11. give it a trystill can't get it to work
  12. i like to use the str_replace to change the header of xml dataoriginal xml data:<?xml version="1.0" encoding="UTF-8"?><tumblr version="1.0"><tumblelog .........i like to replace :<?xml version="1.0" encoding="UTF-8"?>with<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="xsl_template_document"?>how do i handle the special characters in these strings?i try to implement this example. therefore i need to change the header of my xml data to point to my stylesheet xsl file.http://modxcms.com/forums/index.php/topic,....html#msg127144
  13. i have a page that is generated by the cms Modx.using php i fill a textarea on the page with xml datathen using<body onload="displayResult()">i call a function to read the textarea and make it into an xml object so it can be used in this function:http://www.w3schools.com/xsl/xsl_client.aspbut i don't know how to get it in the right encoding to work.when i read the same data from an xml file it works.but i try to make it dynamicaly so it can read the data directly from the tumblr api call.i try to use this function to make the string data into an xml objecthttp://www.hardcode.nl/subcategory_1/artic...l-in-javascriptbut it seems i get html and body tags with it where i only need xml data
  14. i read xml data from the tumblr api using curl and put it in an textarea on an html page. <?phpfunction curl_get_contents ($url) { $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_URL, $url); $html = curl_exec($curl); curl_close($curl); return $html;}$aap = curl_get_contents("http://myblog.tumblr.com/api/read" );echo $aap;?> i try to adjust the following script to read the xml from the textarea and use it.http://www.w3schools.com/xsl/xsl_client.asponly the xml data is in the wrong format.how do i decode / encode it so it will work?
×
×
  • Create New...