RE: (Easy) Passing a Variable From Sitemap to StyleSheet? - One complication

2004-04-11 Thread David Swearingen
Indeed I can use the variable in the stylesheet as described below by
Philip but I failed to anticipate that I have to use the variable
INSIDE of another tag, that is, I have a variable foo that represents a
filename and I have to use it as follows:

[cinclude:include src=foo.xml]   

I'm assuming I can't nest a xsl:value-of tag inside of a
cinclude:include tag...how would I render this value in this manner?

Thanks,
David


--- Philipp Burkert [EMAIL PROTECTED] wrote:
 Hi,
 
  I thought this would be easy...I'm trying to pass a variable 
  defined in the Sitemap, and retrieve it in the Stylesheet.
 
 first you have to handle the parameter to the transformer within the
 sitemap.
 
 ---sitemap--
 map:match pattern=*/show.html
map:generate src=xmldb:xindice-embed:///db/beschlusslage//
map:transform type=xslt src=xslt/antrag2html.xslt
   map:parameter name=oid value={1}/
/map:transform 

 
 
 Then you have to
 - declare the parameter in the xslt
 - and output it later with the $varname syntax
 
 ---xslt--
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
   xsl:output method=xml version=1.0 encoding=UTF-8
 indent=yes/
   xsl:param name=oid/
   ...
   xsl:template match=meta name=antrag
  xsl:value-of select=$oid/
   ...
 
 
 Hope that helps
 
 PHILIPP BURKERT
 [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (Easy) Passing a Variable From Sitemap to StyleSheet? - One complication

2004-04-11 Thread Conal Tuohy
Hi David. This is more of an XSLT question now really, if I understand you
correctly.

You should use attribute value templates (i.e. curly braces):

xsl:variable name=foo/

...

cinclude:include src={$foo}/

You could indeed use xsl:value-of, like this:

cinclude:include
xsl:attribute name=src
xsl:value-of select=$foo/
/xsl:attribute
/cinclude:include

... which is a bit wordy. The attribute value template approach above is
functionally identical - it's just a handy shorthand syntax.

Cheers

Con

 -Original Message-
 From: David Swearingen [mailto:[EMAIL PROTECTED]
 Sent: Monday, 12 April 2004 12:21
 To: [EMAIL PROTECTED]
 Subject: RE: (Easy) Passing a Variable From Sitemap to
 StyleSheet? - One
 complication


 Indeed I can use the variable in the stylesheet as described below by
 Philip but I failed to anticipate that I have to use the variable
 INSIDE of another tag, that is, I have a variable foo that
 represents a
 filename and I have to use it as follows:

 [cinclude:include src=foo.xml]

 I'm assuming I can't nest a xsl:value-of tag inside of a
 cinclude:include tag...how would I render this value in this manner?

 Thanks,
 David


 --- Philipp Burkert [EMAIL PROTECTED] wrote:
  Hi,
 
   I thought this would be easy...I'm trying to pass a variable
   defined in the Sitemap, and retrieve it in the Stylesheet.
 
  first you have to handle the parameter to the transformer within the
  sitemap.
 
  ---sitemap--
  map:match pattern=*/show.html
 map:generate src=xmldb:xindice-embed:///db/beschlusslage//
 map:transform type=xslt src=xslt/antrag2html.xslt
  map:parameter name=oid value={1}/
 /map:transform
 
  
 
  Then you have to
  - declare the parameter in the xslt
  - and output it later with the $varname syntax
 
  ---xslt--
  xsl:stylesheet version=1.0
  xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  xsl:output method=xml version=1.0 encoding=UTF-8
  indent=yes/
  xsl:param name=oid/
...
  xsl:template match=meta name=antrag
   xsl:value-of select=$oid/
...
  
 
  Hope that helps
 
  PHILIPP BURKERT
  [EMAIL PROTECTED]
 
 
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


 __
 Do you Yahoo!?
 Yahoo! Tax Center - File online by April 15th
 http://taxes.yahoo.com/filing.html

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]