The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> XML Programming
|
XSL filter not working
Discuss XSL filter not working in the XML Programming forum on Dev Shed. XSL filter not working XML Programming forum discussing XML and related technologies, including XUL and XSL. XML is a self-describing file format, designed for maximum compatibility between applications.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 22nd, 2011, 08:42 PM
|
|
Registered User
|
|
Join Date: Aug 2011
Posts: 27
Time spent in forums: 7 h 21 m 14 sec
Reputation Power: 0
|
|
|
XSL filter not working
Hi Guys,
I'm trying to filter files to only "jsp" files.
The lines that handle this is :
Code:
<!-- filter the task files to hide files that shouldn't be displayed -->
<xsl:variable name="fileSet" select="$activeTask/Files/File[substring(Vpath,string-length(Vpath)-string-length('.dd') + 1,3) != '.dd']"/>
<table cellpadding="0" cellspacing="0" border="0" class="file-table">
<xsl:apply-templates select="$fileSet[contains(fileSet,'.jsp')]">
<xsl:sort select="Vpath"/>
</xsl:apply-templates>
</table>
I think it is within apply-templates but what I have tried so far doesn't work. I suspect the contains() is appropriate to get desired result.
Thanks for your help.
|

August 23rd, 2011, 02:01 PM
|
|
Registered User
|
|
Join Date: Aug 2011
Posts: 27
Time spent in forums: 7 h 21 m 14 sec
Reputation Power: 0
|
|
Tried below still not working with contains() and ends-width (may not work for me since i'm using xml version = 1, because I think this function uses version 2), anyone out there who can help me.
Code:
<!-- filter the task files to show 'jsp' files that should be displayed -->
<xsl:variable name="fileSet" select="$activeTask/Files/File[substring(Vpath,string-length(Vpath)-4) = '.jpg']"/>
<table cellpadding="0" cellspacing="0" border="0" class="file-table">
<xsl:apply-templates select="$fileSet">
<xsl:sort select="Vpath"/>
</xsl:apply-templates>
</table>
|

August 23rd, 2011, 02:20 PM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
Quote: | Originally Posted by becool321 (may not work for me since i'm using xml version = 1, because I think this function uses version 2) |
XPath 2, not XML.
What are you using to apply the XSLT? I'm guessing Java?
|

August 23rd, 2011, 02:33 PM
|
|
Registered User
|
|
Join Date: Aug 2011
Posts: 27
Time spent in forums: 7 h 21 m 14 sec
Reputation Power: 0
|
|
|
I beleive its Java and yes I'm using XPATH version 1 not 2.
|

August 23rd, 2011, 03:11 PM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
|
Okay, so what library? Saxon? Xalan? WebSphere?
Alternatively, what classes from what namespaces are you using?
|

August 23rd, 2011, 04:02 PM
|
|
Registered User
|
|
Join Date: Aug 2011
Posts: 27
Time spent in forums: 7 h 21 m 14 sec
Reputation Power: 0
|
|
Thanks for replying and offer to help. However issue resolved, solution below:
Code:
<!-- filter the task files to show files that should be displayed -->
<xsl:variable name="fileSet" select="$activeTask/Files/File[contains(Vpath,'.jsp')]"/>
<table cellpadding="0" cellspacing="0" border="0" class="file-table">
<xsl:apply-templates select="$fileSet">
<xsl:sort select="Vpath"/>
</xsl:apply-templates>
</table>
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|