List Info

Thread: Re: XSL and PHP5




Re: XSL and PHP5
country flaguser name
Denmark
2007-03-27 20:58:36
Hi JP,

If you're asking how the code looks, the simplest example is
this:

http://www.indexdata.dk/phpyaz/demo/xsltest.php?qu
ery=computer (assumes 
PHP4).. there's a link to the source code near the top of
the screen.

In practice, there are all kinds of ways that you wrap this
basic logic 
to cope with different capabilities of different servers,
end-user 
requirements, etc..
 
A more sophisticated example of the same general approach to
building a 
client is here: http://locdemo.
indexdata.com/dsearch/ ... or dressed up 
for work: http://www.thdi.org/ ...
these are examples of more 'complete' 
clients that we have built for customers. The Library of
Congress took a 
fairly basic client framework that we built for them and
came up with 
something new, here: http://www.loc.gov/sea
rch/new/ .

Hope this provides some inspiration,

--Sebastian

Lamon Jean-Pierre wrote:

>Hi,
>
>I intend to maybe deploy a php/yaz framework with
XML/XLST. In order to see how the result is looking, has
someone an URL with this implementation where I could see
this?
>
>Thank you
>JP
>
>-----Message d'origine-----
>De : yazlist-bounceslists.indexdata.dk
[mailto:yazlist-bounceslists.indexdata.dk] De la part de
Sebastian Hammer
>Envoyé : lundi, 26. mars 2007 15:58
>À : Discussion on the YAZ Z39.50 toolkit
>Objet : Re: [Yazlist] XSL and PHP5
>
>Hi Hans-Werner,
>
>Thanks for sharing! The way I see it, someone who 'has'
to use the PHP5 
>libxslt-based XSLT processor is lucky. In my experience,
it is faster 
>and better than Sablotron in every way. And PHP5 has
both a better DOM 
>and the really pleasant SimpleXML API to work with XML
records.. it's 
>definitely a very comfortable environment in which to
write XML-based 
>Z39.50/SRU clients.
>
>--Sebastian
>
>Hans-Werner Hilse wrote:
>
>  
>
>>Hi,
>>
>>On Mon, 26 Mar 2007 13:03:49 +0200 "Carlos
Escuriola"
>><escuriolagmail.com> wrote:
>>
>> 
>>
>>    
>>
>>>Has anyone that function translated for PHP5 so
I can use the same
>>>example in my server, or know how can I solve
that problem?
>>>   
>>>
>>>      
>>>
>>Without testing it at all:
>>
>>function display_record($rec, $xslfile) {
>>	$processor=new XSLTProcessor();
>>	$processor->importStylesheet(DOMDocument::load($
xslfile));
>>	print(preg_replace("'</?html[^>]*>'&q
uot;,'',
>>		$processor->transformToXML(DOMDocument::loadXML
($rec))));
>>}
>>
>>For performance reasons, I'd even suggest:
>>
>>function display_record($rec, $xslfile) {
>>	static $processor=false;
>>	if(!$processor) {
>>		$processor=new XSLTProcessor();
>>		$processor->importStylesheet(DOMDocument::load(
$xslfile));
>>	}
>>	print(preg_replace("'</?html[^>]*>'&q
uot;,'',
>>		$processor->transformToXML(DOMDocument::loadXML
($rec))));
>>}
>>
>>
>>OTOH, the XSLT extension is still available as a
PECL extension. And,
>>well, you managed to install another PECL extension:
yaz.
>>
>>
>>Cheers,
>>
>>-hwh
>>
>>_______________________________________________
>>Yazlist mailing list
>>Yazlistlists.indexdata.dk
>>http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yaz
list
>>
>>
>> 
>>
>>    
>>
>
>  
>

-- 
Sebastian Hammer, Index Data
quinnindexdata.com   www.indexdata.com
Ph: (603) 209-6853 Fax: (866) 383-4485



_______________________________________________
Yazlist mailing list
Yazlistlists.indexdata.dk
http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yaz
list

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )