Adding linking functionality to my XSLT in Drupal

redss

New Member
I have an XML feed that I have transformed into HTML for a dynamic Drupal page, courtesy of the nice users at drupal.stackexchange.com. The issue, however, is that the XML feed lists everything that could possibly ever need to be known, and my requirements are that each page renders a certain subset of information. Essentially, it is a presentation schedule that needs to be broken down.My example feed is as follows:<track name="Track 1"> <session name="Session 1" starttime="2012-06-06 10:45" endtime="2012-06-06 12:45"> <presentation name="Presentation 1"> <author>Name 1</author> <author>Name 2</author> <abstract>summary of this presentation</abstract> </presentation> <presentation name="Presentation 2"> ...presentation info </presentation> </session> <session name="Session 2" starttime="2012-06-06 10:45" endtime="2012-06-06 12:45"> <presentation name="Presentation 3"> ...presentation info </presentation> <presentation name="Presentation 4"> ...presentation info </presentation> </session> <session name="Session 3" starttime="2012-06-07 08:45" endtime="2012-06-07 10:45"> <presentation name="Presentation 5"> ...presentation info </presentation> <presentation name="Presentation 6"> ...presentation info </presentation> </session></track>So, as you can see, I get all information for this entire proceeding. Every single track, session, and presentation all in one feed. As of right now, I can parse that into a dynamic page without any issue.Essentially, here is what I would like to get it to (ignoring the parsing of the dateTime...I have that in place already):<h2>Track 1</h2><h3>Session 1</h3><ul> <li><a href="http://stackoverflow.com/questions/11370739/presentation-1.html">Presentation 1</a></li> <li><a href="http://stackoverflow.com/questions/11370739/presentation-2.html">Presentation 2</a></li></ul><h3>Sessoin 2</h3><ul> <li><a href="http://stackoverflow.com/questions/11370739/presentation-3.html">Presentation 3</a></li> <li><a href="http://stackoverflow.com/questions/11370739/presentation-4.html">Presentation 4</a></li></ul>And then, clicking one of the presentation links would take you to a new page:<h2>Presentation 1</h2><p>Presented by Name 1, Name 2</p><p>summary of this presentation</p>So, I have two issues here ... I don't exactly know how to break up a feed in this manner, and this must be done within a Drupal 6 module. I am just showing a snippet of a sample feed...because the feed that I do get is quite large, and must be broken up in this manner.The Drupal code that I have is as follows:function _xml_import_generate(){ $path = drupal_get_path('module', 'xml_import'); $xsl = new DOMDocument(); $xsl->load("{$path}/xml_import.xsl"); $xslt = new XSLTProcessor(); $xslt->importStyleSheet($xsl); $xml = new DOMDocument(); $xml->load("myfeed.xml"); return (string) $xslt->transformToXML($xml);}
 
Back
Top