Search

I've been crushing my head against this problem for hours. I think I need a fresh approach to it.

I have a “Tweets” section where I import the statuses from a Twitter list. I also have an “Authors” section where I store the authors’ information such as the full name and the bio. I need to match the shortname from the tweet to the shortname of the “Authors” section so that I can retrieve the author’s information for each tweet in a list.

What I'm thinking of is to test the short name of each tweet against a DS that outputs all the authors and their info… but I can’t find a way to do it.

I tried to link the two sections without success, since the input of the “Tweets” section is done with an XML importer.

I’m really lost, any help will be appreciated :-)

Can you show a snippet of your XML? One entry of each section should be sufficient.

Eh, wait. Did you mean in your Data Sources or in the XML?

I would use the Parametrisator extension on the twitter ds. This way you can select exactly the node you need as the parameter output and then chain it with your authors datasource.

Maybe my problem is with XSLT (of my lack of knowledge of it). How do I retrieve the full name of the author from the tweets?

Here is my xml for the Authors section

  <autori>
   <section id="4" handle="autori">Autori</section>
    <entry id="2686">
      <shortname handle=“user1”>user1</shortname>
      <fullname handle=“user-one”>User One</fullname>
   </entry>
    <entry id="2687">
      <shortname handle=“user2”>user2</shortname>
      <fullname handle=“user-Two”>User Two</fullname>
   </entry>
    <entry id="2703">
      <shortname handle=“user3”>user3</shortname>
      <fullname handle=“user-Three”>User Three</fullname>
   </entry>
  </autori>

And this is for the tweets

<tweets>
   <section id="1" handle="tweets">Tweets</section>
    <entry id="2725">
      <autore handle="user3">user3</autore>
     <tweet>Etiam at risus et justo</tweet>
   </entry>
    <entry id="2726">
      <autore handle="user2">user2</autore>
     <tweet>Vivamus hendrerit arcu sed erat molestie vehicula. Sed</tweet>
    </entry>
</tweets>

You could use a key.

I'm not sure I understand you completely but, if you have both authors and tweets in your XML output, could you not simply use:

(In a `tweets/entry' `for-each` loop or `template`…)
Full name: <xsl:value-of select="/data/autori/entry[shortname/@handle = current()/autore/@handle]/fullname"/>

That is: in a loop/template for each tweet you select the proper fullname of autori based on the tweets/entry/autore/@handle

Thanks a lot everybody!

Looks like the key was in fact The Key. There is a good tutorial here but it’s not very difficult to understand anyway.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details