cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: XSP taglib question
Date Fri, 16 Jun 2000 16:20:37 GMT
On Wed, 14 Jun 2000, Giacomo Pati wrote:

> Hi guys
> 
> I've made a silly experience right now. My taglib looks like:
> 
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>     xmlns:pwr="http://www.pwr.ch/2000/XSP/PWR"       <-- My own one
>     xmlns:sql="http://www.apache.org/1999/SQL"       <-- donald's sql one
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:xsp="http://www.apache.org/1999/XSP/Core">
> 
>   <xsl:template match="pwr:dbitemselector">
>     <dbitemselector>
>       <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
>       <xsl:attribute name="target"><xsl:value-of select="@target"/></xsl:attribute>
>       <xsl:attribute name="text-element"><xsl:value-of select="@optiontext"/></xsl:attribute>
>       <sql:execute-query>
>         <sql:driver>postgresql.Driver</sql:driver>
>         <sql:dburl>jdbc:postgresql://localhost/turbine</sql:dburl>     
>         ...
>       </sql:execute-query>
>     </dbitemselector>
>   </xsl:template>
> </xsl:stylesheet>
> 
> and my xsp looks like:
> 
> <?xml version="1.0"?>
> <?cocoon-process type="xsp"?> 
> <?cocoon-process type="xslt"?>
> <?xml-stylesheet href="page-html.xsl" type="text/xsl"?>
> 
> <xsp:page 
>     xmlns:pwr="http://www.pwr.ch/2000/XSP/PWR"
>     xmlns:sql="http://www.apache.org/1999/SQL"
>     xmlns:xsp="http://www.apache.org/1999/XSP/Core">
>   <page>
> 
>     <pwr:dbitemselector name="id" target="EditAufwandtyp.xml" 
>       optionid="id" optiontext="bezeichnung" table="aufwandtyp">
>     </pwr:dbitemselector>
>   </page>
> </xsp:page>
> 
> I've realized that no matter in which order I specify the xmlns:pwr
> and xmlns:sql on the tags above it always works as expected !?!?! And
> I tell ya I've always killed the repository and restarted tomcat
> before a new test.

Dang. I can't tell if that's counterintuitive or if the xsp processor is
doing the right thing... I should patch the xsp processor to notify me
every time it transforms the document so I can keep tabs on what's going
on - in this case, it might be that when you reverse the order of tags,
it's doing sql, then pwr, then sql again (from the namespace declarations
in the pwr taglib)...?

 One other unfortunate thing I've noticed - I _must_ declare all of the
namespaces that will ever be used during the processing of an xsp document
in the initial document, even if no tags from that namespace occur there.
That means I must know, when writing a page using my news: elements, what
taglibs the news taglib is going to call. I find that to be bad design -
it means I'd have to go back and edit all of my pages if I chose to have
the news taglib use another taglib for its data gathering (ldap instead of
sql, say) - which undermines part of the benefit of using a "high-level"
namespace to hide the gory details from the page authors.

- donald


Mime
View raw message