Hi, again :)
I found another way of doing it :D
In the dbforms-config.xml i declare things in another way.
like this:
              <field name="tipo" isForeignKey="true" fieldType="int" size="10">
                        <foreign-key  name="FK_tabela_tabela_tipos"
                      foreignTable="tabela_tipos"
                      displayType="select"
                      foreign="id_tipo"
                      visibleFields="descricao"/></field>

So i have direct acess to the foreign table, etc... and then in the xsl i do 
something very simple

 <xsl:choose>
 <xsl:when test="@isForeignKey='true'">
       <db:dataLabel fieldName="[EMAIL PROTECTED]" >
        <xsl:for-each select="foreign-key">
                <xsl:variable name="temp_name" select="@name"/>
                <xsl:variable name="foreign_table" select="@foreignTable" />
                <xsl:variable name="visib_fields" select="@visibleFields"/>
                <xsl:variable name="str_field" select="@foreign" />
        <db:tableData name="{$temp_name}"  foreignTable="{$foreign_table}" 
         visibleFields="{$visib_fields}" storeField="{$str_field}"/> 

        </xsl:for-each>
        </db:dataLabel>
</xsl:when>
<xsl:otherwise>
        <db:label fieldName="[EMAIL PROTECTED]" />
</xsl:otherwise>
</xsl:choose>


Did you get the idea???? Now to put selects or labels with data that is in 
other tables it becomes very very easy to implement. The problem is just to 
change your dbforms-config.xml. And my question also goes there... does this 
change afect anything else? i didn't notice anything.. it works fine here. Tell 
me something if you try this out.

Andr� Moniz


> 
> > I am trying to create my files with stylesheets with xsl but i have a 
> > problem.
> > Imagine you want to make a list with generate_lists.xsl and then in each 
> > field
> > you need to know if it is a foreign-key or no, to set a tableData(a 
> > select) or
> > just a label.
> > If it is a foreign key i need to acess to the foreign_table and get what 
> > i
> > want. So i have this in dbforms_config.xml:
> >             <foreign-key  name="FK_tabela_tabela_tipos"
> >                   foreignTable="tabela_tipos"
> >                   displayType="select">
> >                  <reference local="tipo"
> >                           foreign="id_tipo"/>
> >             </foreign-key>
> >
> > And i want to do something like this in generate_lists.xsl but i don't 
> > see a way
> >
> > <xsl:for-each select="field">
> >      if (is a foreign-key) so put a select with tabledata
> >      else put a label with the value
> >
> > Is it possible in this way?
> 
> I think that was the intention but it was never implimented.  So at the 
> current time, I think the xsl sheets would need to be modified to allow 
> for that.  You might search the archives for discussion on tha( um 
> actually I just tried on the developers list and it seems to be searching 
> the wrong list unless I specify "Require All Words").  How are you at xsl 
> transformation?  Care to learn (heh heh) ;^)
> 
> 
> This is what the UsersGuide has to say.
> 
> 22.3. Support within XSL Stylesheets
> 
> This has been assigned, but it is not yet implemented (as of 1.1.2pr2).
> 
> But I also found this message in the developers list so am not sure the 
> exact state of affairs here -->
> 
>   Dirk suggested that I send a summary of the changes that I want to 
> integrate
>   into DBForms...
> 
>   Basically, I have added into my dbforms-config.xml some extra Forign Key
>   elements:
>       <table name="TRAFFIC">
>           <field name="TRAFFIC_ID" fieldType="int identity" size="10"
>   isKey="true" autoInc="true"/>
>           <field name="REDIRECTION_ID" fieldType="int" size="10"/>
>           <field name="EMAIL_ID" fieldType="int" size="10"/>
>           <field name="CAMPAIGN_ID" fieldType="int" size="10"/>
>           <field name="TRAFFIC_DTIME" fieldType="datetime" size="23"/>
>           <field name="QUERYSTRING" fieldType="varchar" size="512"/>
>           <field name="REFER_URL" fieldType="varchar" size="512"/>
>           <foreign-key foreignTable="EMAIL">
>               <reference local="REDIRECTION_ID" foreign="REDIRECTION_ID"/>
>           </foreign-key>
>           <foreign-key foreignTable="EMAIL">
>               <reference local="EMAIL_ID" foreign="EMAIL_ID"/>
>           </foreign-key>
>           <foreign-key foreignTable="CAMPAIGN_ID">
>               <reference local="CAMPAIGN_ID" foreign="CAMPAIGN_ID"/>
>           </foreign-key>
>           <!-- add "granted-privileges" element for security constraints -->
> 
>       </table>
> 
>   Also, since I don't want the id, but the name of the forign key to show 
> up,
>   I added a layout data elements:
>        <layout-config>
>           <col name="EMAIL_ID" displayField="EMAIL" displayType="select"/>
>           <col name="CAMPAIGN_ID" displayField="DESCRIPTION"
>   displayType="select"/>
>       </layout-config>
> 
> 
>   These foreign keys allow me to produce Stylesheet XSL transformations that
>   produce pages that have forign key information in them.  Please see the
>   attached images for an example.
> 
>   I would like to get these style sheets contributed over sooner versus 
> later,
>   what is the best way for me to do that?  A big zip file?
> 
> (note the attached images specified were not available in the mailing list)
> -- 
> Shawn
> 
> Happily using M2, Opera's revolutionary e-mail client: 
> http://www.opera.com/m2/
> 


Andr� Moniz


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to