Dropdowns not showing values

M

Matt

I'm using a secondary data file to populate dropdowns, and am having trouble
getting any items to show up in the dropdown.

My XML file looks like this:
<xml>
<applications>
<special_lookup>sponsor
<lookupItemid lookupItemTitle="Text1" Status="A">1</lookupItemid>
<lookupItemid lookupItemTitle="Text2" Status="B">2</lookupItemid>
<lookupItemid lookupItemTitle="Text3" Status="C">3</lookupItemid>
</special_lookup>
</applications>
</xml>

My Entries box contains the following:
/xml/applications/special_lookup/lookupItemid[..= "sponsor"]

When set up like this, I get no values in the dropdown when I preview or run
the form.

If I change the XML file to look like this:
<xml>
<applications>
<special_lookup name="sponsor">
<lookupItemid lookupItemTitle="Text1" Status="A">1</lookupItemid>
<lookupItemid lookupItemTitle="Text2" Status="B">2</lookupItemid>
<lookupItemid lookupItemTitle="Text3" Status="C">3</lookupItemid>
</special_lookup>
</applications>
</xml>

And use the following in the Entries box:
/xml/applications/special_lookup/lookupItemid[../@name = "sponsor"]

I get the values in the dropdown.

I assume I’m missing something in the Entries box that causes it to show no
values in the dropdown. Any ideas?

Thanks
 
S

ScottD[Interlink Group]

Matt,
Your problem is due to the sponsor being a text node within special_lookup.
In the case where you are having a problem with the XPath expression "[.. =
sponsor]" you are not getting the result you expect because the text value of
... (which is the special_lookup node) is actually going to be equal to
something like "sponsor123" because the special_lookup node has mixed
content. The text value of a node is the contatenation of all text nodes
within that node and all of its child nodes.
 
E

em

hi,
maybe this can help you:Change the Entries box to
/xml/applications/special_lookup/lookupItemid[contains(.., "sponsor")]
regards
em
 
M

Matt

Thanks, Scott. I was able to get the XML file modified, so it has a 'name'
node in it. I appreciate the information, though. You never know when stuff
comes in handy.

ScottD said:
Matt,
Your problem is due to the sponsor being a text node within special_lookup.
In the case where you are having a problem with the XPath expression "[.. =
sponsor]" you are not getting the result you expect because the text value of
.. (which is the special_lookup node) is actually going to be equal to
something like "sponsor123" because the special_lookup node has mixed
content. The text value of a node is the contatenation of all text nodes
within that node and all of its child nodes.


Matt said:
I'm using a secondary data file to populate dropdowns, and am having trouble
getting any items to show up in the dropdown.

My XML file looks like this:
<xml>
<applications>
<special_lookup>sponsor
<lookupItemid lookupItemTitle="Text1" Status="A">1</lookupItemid>
<lookupItemid lookupItemTitle="Text2" Status="B">2</lookupItemid>
<lookupItemid lookupItemTitle="Text3" Status="C">3</lookupItemid>
</special_lookup>
</applications>
</xml>

My Entries box contains the following:
/xml/applications/special_lookup/lookupItemid[..= "sponsor"]

When set up like this, I get no values in the dropdown when I preview or run
the form.

If I change the XML file to look like this:
<xml>
<applications>
<special_lookup name="sponsor">
<lookupItemid lookupItemTitle="Text1" Status="A">1</lookupItemid>
<lookupItemid lookupItemTitle="Text2" Status="B">2</lookupItemid>
<lookupItemid lookupItemTitle="Text3" Status="C">3</lookupItemid>
</special_lookup>
</applications>
</xml>

And use the following in the Entries box:
/xml/applications/special_lookup/lookupItemid[../@name = "sponsor"]

I get the values in the dropdown.

I assume I’m missing something in the Entries box that causes it to show no
values in the dropdown. Any ideas?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top