Getting specific values

Posted on 2008-11-18
Last Modified: 2013-11-18
Hello Experts,

I have xml file which contains id like below...

<test id=""/>
<test id="test.two:test02:get"/>
<test id="test.three:test03:getid"/>
<test id="test.four:test04:get"/>
<test id=""/>
<test id=""/>
<test id=""/>
<test id=""/>

I would like to get only those id which contains :get and nothing else [getid] or :set and not[:setid]

I have done like this but it output setid and getid also

<xsl:if test="contains(@id,':set') or contains(@id,':get')">


can u please suggest xslt code for this.
Question by:ShaileshShinde
    LVL 60

    Accepted Solution

    try this
            <xsl:if test="tokenize(@id, ':') = 'get' or tokenize(@id, ':') = 'set'">
    (XSLT2 only)
    XSLT1 is easy too if you need that
    LVL 1

    Author Comment

    Hello Expert,

    Thanks I will test this and reply you.

    LVL 1

    Author Closing Comment

    Thanks Expert
    LVL 60

    Expert Comment

    by:Geert Bormans

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
    It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now