It's all about the answers!

Ask a question

HTTP Filtered Value Set, xpath, attribute with space


0
1
Durand Guillaume (634) | asked Nov 25 '14, 5:55 a.m.
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

4 answers



permanent link
Donald Nong (14.5k614) | answered Nov 25 '14, 9:14 p.m.
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.

permanent link
Brian Fleming (1.6k11928) | answered Nov 25 '14, 10:15 a.m.
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.

Comments
Durand Guillaume commented Nov 25 '14, 2:14 p.m.

 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???


Eric Jodet commented Nov 26 '14, 4:00 a.m.
JAZZ DEVELOPER

 Bonjour Guillaume,

which version of RTC are you using?

Eric


permanent link
Roberto Marcon (111) | answered Apr 11 '17, 7:09 a.m.
edited Apr 11 '17, 10:26 a.m.

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


permanent link
Roberto Marcon (111) | answered Apr 21 '17, 3:01 a.m.

 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>

Your answer


Register or 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.