You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Wadim Kruse <z-...@web.de> on 2007/05/23 22:52:08 UTC

jstl 1.1.2, xml - how to concat two variables?

Hi,

I wasn't able to figure out, how to concat two variables (xml-document and
xpath-expression).
The documentation says that "XPathExpression" in <x:set var="" select="">
should be a string literal... What is the way to use a variable
XPathExpression to select an xml-fragment? I don't want to hard-code it in
the JSP. In case it's not possible to concat two variables, what would be
the alternative to do that? SAX-filter?

Best regards,
Wadim


----------------------------------------------------------------------------------------------
<%@ pagelanguage="java"contentType="text/html; charset=UTF-8" 
        pageEncoding="UTF-8"%> 

<%@ taglibprefix="c"uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglibprefix="x"uri="http://java.sun.com/jsp/jstl/xml"%> 

<c:setvar="doc"> 
        <c:importurl="data/collection.xml"></c:import> 
</c:set> 

<c:setvar="xpath"> 
       ...some xpath-expression...
</c:set> 

<c:setvar="xsl"> 
        <c:importurl="styles/tree2.xsl"></c:import> 
</c:set> 

<x:parsevar="xml"xml="${doc}"/> 

<x:setvar="test"select="$xml$xpath"/>   <!-- DOESN'T WORK!!! , hard-coded
xpath works... -->

<x:outselect="{$test}"/>
-- 
View this message in context: http://www.nabble.com/jstl-1.1.2%2C-xml---how-to-concat-two-variables--tf3806497.html#a10772551
Sent from the Taglibs - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: jstl 1.1.2, xml - how to concat two variables?

Posted by Wadim Kruse <z-...@web.de>.
Problem solved another way around: JSP which returns an XSL-Stylesheet.


Wadim Kruse wrote:
> 
> Hi,
> 
> I wasn't able to figure out, how to concat two variables (xml-document and
> xpath-expression).
> The documentation says that "XPathExpression" in <x:set var="" select="">
> should be a string literal... What is the way to use a variable
> XPathExpression to select an xml-fragment? I don't want to hard-code it in
> the JSP. In case it's not possible to concat two variables, what would be
> the alternative to do that? SAX-filter?
> 
> Best regards,
> Wadim
> 
> 
> ----------------------------------------------------------------------------------------------
> <%@ pagelanguage="java"contentType="text/html; charset=UTF-8" 
>         pageEncoding="UTF-8"%> 
> 
> <%@ taglibprefix="c"uri="http://java.sun.com/jsp/jstl/core"%> 
> <%@ taglibprefix="x"uri="http://java.sun.com/jsp/jstl/xml"%> 
> 
> <c:setvar="doc"> 
>         <c:importurl="data/collection.xml"></c:import> 
> </c:set> 
> 
> <c:setvar="xpath"> 
>        ...some xpath-expression...
> </c:set> 
> 
> <c:setvar="xsl"> 
>         <c:importurl="styles/tree2.xsl"></c:import> 
> </c:set> 
> 
> <x:parsevar="xml"xml="${doc}"/> 
> 
> <x:setvar="test"select="$xml$xpath"/>   <!-- DOESN'T WORK!!! , hard-coded
> xpath works... -->
> 
> <x:outselect="{$test}"/>
> 

-- 
View this message in context: http://www.nabble.com/jstl-1.1.2%2C-xml---how-to-concat-two-variables--tf3806497.html#a10780246
Sent from the Taglibs - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org