Using wildcards in xsl select

I am trying to create an XSL file that limits the output based on part of one field.  While I understand that you can do this using XML, I have yet to find exactly the correct syntax.  If someone could provide a link / sample code on how to do this, it would be greatly appreciated!

Thanks!
LVL 1
nwcc_seattleAsked:
Who is Participating?
 
rdcproConnect With a Mentor Commented:
I guess I don't see what it is you're trying to accomplish.  You need to post some sample XML, and what you'd like to see output.  

If you can't post something specific (for whatever reason), I have tons of examples of various XML/XSLT on my site at http://rdcpro.com 

Regards,
Mike Sharp
0
 
rdcproCommented:
There are a lot of ways to accomplish this, but as an example, let's say you want an element that contains the first 5 characters in element myField:

<xsl:apply-templates select="/Some/Path/Here[contains(substring(myField, 1, 5))]"/>

You can make it case insensitive with the translate() function:

translate(myField, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")

For a dynamic filtering and sorting example:

http://rdcpro.com/Members/rdcpro/snippets/filterandsort/

Regards,
Mike Sharp
0
 
nwcc_seattleAuthor Commented:
That looks great, but I am trying to do a hard code version (not based on what people type in)....   I;m trying to start simple with this.

the code I have so far is

<xsl:for-each select="xml element name goes here">
I know something relating to the contain function goes at the end, but I don't know what....

Any suggestions?

Thanks
0
 
nwcc_seattleAuthor Commented:
Worked great!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.