xsl-list
[Top] [All Lists]

RE: dynamic document() template problem (with Xalan)

2005-06-21 07:24:35
Hey,
I was wondering if I could use dyn:evaluate just the
same? Just because I am using just Fop (1 step of
providing the xml/xsl files), rather than pipe through
Saxon, then Fop. Unless theres a way to access saxon
extensions while still using Xalan.

I have access to the EXSLT dyn:evaluate() function...
I tried doing something using this to no avail.

<xsl:apply-templates
select="document(@href)/Document/dyn:evaluate(current()/@nodes)"/>


Extra illegal tokens: '(', 'current', '(', ')', '/',
'@', 'nodes', ')'



--- Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:

Curly braces are never used within an XPath
expression: they are only used
when an XPath expression is embedded in text within
an attribute value
template.

In standard XSLT, you can't construct an XPath
expression dynamically from a
string, or interpret an XPath expression held in a
source document. However,
Saxon (and some other products) have an extension to
do this:

<xsl:apply-templates

select="document(@href)/Document/saxon:evaluate-node(current()/@nodes))"/>

(This is Saxon 8.4)

(You'll see saxon:evaluate() more often than
saxon:evaluate-node(). The main
difference is that evaluate-node() takes namespace
prefixes from the
namespace context in the source document, not from
the namespace context in
the stylesheet.)

Michael Kay
http://www.saxonica.com/


-----Original Message-----
From: Arian Hojat
[mailto:arianhojat2000(_at_)yahoo(_dot_)com] 
Sent: 20 June 2005 20:30
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] dynamic document() template problem

Hello i am trying to base a template rule off an
attribute in my XML to which chooses nodes to
apply 

###my XML###
<include href="fbackground.xml"
nodes="fb/section1/*"/>

###my rule for <include>###
<xsl:apply-templates
select="document(@href)/Document/{(_at_)nodes}"/>

but i get an error with Saxon...
[ERROR]


javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: A
location
step was expected following the '/' or '//' token.
without the {}, i know it will just check to see
if it
has an attrbiute, but i would like it to get
intrepeted to
'document(fbackground)/Document/fb/section1/*'



            

____________________________________________________

Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy
Football 
http://football.fantasysports.yahoo.com



--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





                
____________________________________________________ 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--