You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Braumüller, Hans <H....@hanseorga.de> on 2007/03/07 16:27:26 UTC

converting string to xpath for document funtion ?

Hello,

i am trying following:

I defined some layout properties in an external document, saved in
  <xsl:variable name="docProperties" select="document($p_propFile,document(''))"/>

Then i want by  condition, different properties, like for example:

    <xsl:variable name="path">
      <xsl:choose>
        <xsl:when test="$nodeName = 'funktionen' ">/root/klasse/funktion/head</xsl:when>
        <xsl:otherwise>/root/head</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>

Now my pseudo-code (It´s not working :-( ) :

<xsl:variable name="headProp" select="xalan:nodeset( concat ($docProperties, $path) ) "/>

to display following output:

      <fo:table-header>
    	  <xsl:copy-of select="$headProp/@*" />


Any Idea ?

A requirement is to put the layout properties in an external properties.xml,
if not i could put the nodeset with my properties in the same xslt-stylesheet, i think. 

Thanks,

Hans
Mail Art > http://crosses.net














--------------------------------------------------------------------------------------
Besuchen Sie Hanse Orga vom 27. - 28.03.2007 beim
Internationalen SAP-Kongress für Versicherungen
Payment Factory in SAP®: Zahlungsverkehr mit dem ipcNavigator® 
Moneta® fuer SAP®: Integriertes Finanzmanagement in SAP 
AutoBank® fuer SAP®: Kontoauszugsverarbeitung (FI/FS-CD) 
Sie finden uns in der 1. Etage / Stand-Nr. 14!
--------------------------------------------------------------------------------------
NEU: Registrieren Sie sich jetzt fuer den Hanse Orga Newsletter! 

 
Hanse Orga AG, Oldesloer Strasse 63, 22457 Hamburg, Amtsgericht Hamburg, HRB 80900, Steuer-Nr. 054 850 02946, Ust-ID-Nr. DE 118662733
Aufsichtsratvorsitzender Fritz Horst Melsheimer; Vorstandsvorsitzender Hans-Herbert Lindemann; Vorstand Sven Lindemann; Vorstand Stephan Benkendorf

Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: converting string to xpath for document funtion ?

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Mar 7, 2007, at 16:27, Braumüller, Hans wrote:

Hi,

> i am trying following:
>
> I defined some layout properties in an external document, saved in
>   <xsl:variable name="docProperties" select="document 
> ($p_propFile,document(''))"/>
>
> Then i want by  condition, different properties, like for example:
>
>     <xsl:variable name="path">
>       <xsl:choose>
>         <xsl:when test="$nodeName = 'funktionen' ">/root/klasse/ 
> funktion/head</xsl:when>
>         <xsl:otherwise>/root/head</xsl:otherwise>
>       </xsl:choose>
>     </xsl:variable>
>
> Now my pseudo-code (It´s not working :-( ) :

Nope, you cannot create something like a dynamic XPath expression  
with standard XSLT 1.0

What you could do, IIC, is:

<xsl:variable name="headProp">
   <xsl:choose>
     <xsl:when test="$nodeName = 'funktionen'">
       <xsl:copy-of select="$docProperties/root/klasse/funktion/head/ 
@*" />
     </xsl:when>
     <xsl:otherwise>
       <xsl:copy-of select="$docProperties/root/head/@*" />
     </xsl:otherwise>
   </xsl:choose>
</xsl:variable>

<fo:table-header>
   <xsl:copy-of select="$headProp" />
...

Untested, though, may need some tweaking...

Cheers,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org