Re: XSLT issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




$xml = "blah balh blah";
$tournaments = explode("</tournament>", $xml);
$tournaments = array_slice($tournaments, 0, 3); //maybe 4
$xml = implode("</tournament>", $tournaments);
$xml .= "\n</xmlfeed>";

"Crude, but effective Captain"  -- Spock

On Wed, May 3, 2006 5:40 am, Dave Goodchild wrote:
> Hi all, maybe slightly off list but I AM using php and Sablotron to
> generate
> xslt.
>
> I have a live poker games feed that takes the following format:
>
> <?xml version="1.0" encoding="utf-8"?><xmlfeed>
> <tournament>
>     <tid>10035522</tid>
>     <name>Texas Holdem</name>
>     <game>Texas Holdem Poker</game>
>     <buyin>5</buyin>
>     <entryfee>0.5</entryfee>
>     <currency>USD</currency>
>     <state>Running</state>
>     <players>110</players>
>     <blindstructure>Normal NL 1</blindstructure>
>     <type>Regular</type>
>     <limit>No Limit</limit>
>     <starttime>2006-04-24T07:00:00</starttime>
> </tournament>
>
> <tournament>
>     <tid>10035126</tid>
>     <name>Texas Holdem</name>
>     <game>Texas Holdem Poker</game>
>     <buyin>20</buyin>
>     <entryfee>2</entryfee>
>     <currency>USD</currency>
>     <state>Running</state>
>     <players>79</players>
>     <blindstructure>Normal NL 1</blindstructure>
>     <type>Regular</type>
>     <limit>No Limit</limit>
>     <starttime>2006-04-24T08:00:00</starttime>
> </tournament>
>
> etc etc
>
> and all I want to do is output the first THREE tournament elements and
> no
> more. I realise XSLT has no general repetition mechanism but does
> anyone
> know how I would do this? Thanks in advance, and to my Dutch friend, I
> meant
> it when I said lovely baby.
>
> --
> http://www.web-buddha.co.uk
>
> dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml,
> css)
>
> look out for project karma, our new venture, coming soon!
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux