Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

HTTP Filtered Value Set, xpath, attribute with space

I use //node1/node2[contains(./node3,'${my_attribute_ID.value}')] but if the attribute contains space. The node not find.

How to obtain the node that corresponds to the attribute with space?

Guis

1

0 votes



4 answers

Permanent link
Which version of RTC are you using? There is a known defect about white space in XPath.
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/249279
This is mentioned in the jazz.net article
https://jazz.net/library/article/1257
Based on the comments in both the work item and the jazz.net article. It appears that people are still having problems with the white space. I suggest you open a ticket and present your case for a thorough investigation.

1 vote


Permanent link
Are you sure you're using the attribute ID and not the attribute name in your xpath expression?  If you are sure, how did you create an attribute id with a space in it?  Both the Eclipse and Web UIs prevent this.

0 votes

Comments

 Yes I use the attribute ID. I don't have create a attribute ID with a space.


I have a resultat if the value of attribute don't  have a space BUT I don't have a resultat if the value of attribute have a space.

So, ${my_attribute_ID.value} recove the value of attribute but not the space.

Exemple
Value field
dog cat    :     no resultat (because space)
fish           :    resultat ok



WHY???

 Bonjour Guillaume,

which version of RTC are you using?

Eric


Permanent link

Hi!
I've a similar problem (RTC v.5.02) and I tried all xpath possibilities to bypass the problem without any result. So, I have:

  1. An enumerator defined as follow:
Name: Corporation
Enumeration Literals:
Name
Name Space
Name Space1
Name Space2

2. An HTTP Filtered Value Set as follow

XML Data Source: https://localhost:9443/Data/ufficio_richiedente.xml
Row XPath Expression: /xml/node[contains(./nomeBanca, "${it.gvb.customattribute.corporation.label}")]/ufficio
Column XPath expression: ./nomeBanca
Entry label format: ${0}

Apply filter string to values received from datasource = CHECKED
Ignore invalid SSL certificates = CHECKED

3. Ufficio_richiedente.xml as follow:

       <?xml version="1.0" encoding="UTF-8"?>
        <xml>
         <node> <nomeBanca>Name</nomeBanca>
    <codBanca>6</codBanca>
    <ufficio>6 - 0303 - NEW</ufficio>
  </node>
  <node>
    <nomeBanca>Name Space</nomeBanca>
    <codBanca>9</codBanca>
    <ufficio>9 - 1147 - NEW</ufficio>
  </node>
  <node>
    <nomeBanca>Name Space1</nomeBanca>
    <codBanca>2</codBanca>
    <ufficio>3 - 1117 - NEW</ufficio>
  </node>
</xml> 

When ${it.gvb.customattribute.corporation.label} input is “Name” the xpath match, instead when the input is “Name Space” or “Name Space1” there is no match and the dropdown shows loading label.


I also tried with:

  1. Xpath tester --> it works properly
  2. Using fixed value instead the variable, like /xml/node[contains(./nomeBanca, "Name Space")]/ufficio  --> it works properly

Any idea? 

thanks Rob

0 votes


Permanent link

 In target match user %20 as space. So, you will have:


<?xml version="1.0" encoding="UTF-8"?>
<xml>  
  <node>
    <user>Roy%2Lichtenstein</user>
    <email>roy.lichtenstein@artcome.com</email>
    <category>Painter</category>
  </node>
</xml>

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,126

Question asked: Nov 25 '14, 5:55 a.m.

Question was seen: 4,823 times

Last updated: Apr 21 '17, 3:01 a.m.

Confirmation Cancel Confirm