XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 22nd, 2011, 08:42 PM
becool321 becool321 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 27 becool321 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #2  
Old August 23rd, 2011, 02:01 PM
becool321 becool321 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 27 becool321 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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>

Reply With Quote
  #3  
Old August 23rd, 2011, 02:20 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,718 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 7 h 34 m 16 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
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?

Reply With Quote
  #4  
Old August 23rd, 2011, 02:33 PM
becool321 becool321 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 27 becool321 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #5  
Old August 23rd, 2011, 03:11 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,718 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 7 h 34 m 16 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Okay, so what library? Saxon? Xalan? WebSphere?
Alternatively, what classes from what namespaces are you using?

Reply With Quote
  #6  
Old August 23rd, 2011, 04:02 PM
becool321 becool321 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 27 becool321 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL filter not working

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap