Jump to content

managing multiple values within a single XML attribute


Recommended Posts

Good Day!We would like to seek help on managing multiple values within a single XML attribute.

  1. <Row>
  2. <title>type Title here</title>
  3. <description>type Description here</description>
  4. <stage>Development</stage>
  5. <platform>Java, .NET, Mainframe</platform>
  6. <lifecycle>Custom Development</lifecycle>
  7. <servicegroup>System Integration (SI), Technology Consulting (TC)</servicegroup>
  8. </Row>

With the above sample xml, as you may notice, <platform> does have 3 values; (1) Java, (2) .NET and (3) Mainframe. We were able to load them separately. NOTE: We have 4 filters; (1) stage, (2) platform, (3) lifecycle and (4) servicegroup. PROBLEM: When we try to filter the platform and servicegroup. Scenario#1, we selected "Java" in the platform filter and use "where" condition. RESULT: It loads those items that has <platform>Java</platform> only and does not include <platform>Java, .NET, Mainframe</platform>. [bAD RESULT] Scenario#2, we selected "Java" in the platform filter and use "like" condition. RESULT: It loads all items that has <platform>Java</platform> and include <platform>Java, .NET, Mainframe</platform>. [GOOD RESULT] But the catch in using "like" condition is that it conflicts with platform values for "Oracle"...

  1. <platform>Oracle</platform>
  2. <platform>Oracle - PeopleSoft</platform>
  3. <platform>Oracle - Retek</platform>
  4. <platform>Oracle - Siebel</platform>

Oracle - PeopleSoft, Oracle - Retek and Oracle - Siebel are different to each other. So, what if I selected "Oracle" for platform filter? We expected items which only have <platform>Oracle</platform> and not all of those items that has "Oracle".Any help appreciated.

Link to post
Share on other sites

how about splitting the sub entries into tags within the tag, like changing:

<platform>Java, .NET, Mainframe</platform>

to something like:

<platform>	<subentry>Java</subentry>	<subentry>.NET</subentry>	<subentry>Mainframe</subentry></platform>

and

<servicegroup>System Integration (SI), Technology Consulting (TC)</servicegroup>

into:

<servicegroup>	<subentry>System Integration (SI)</subentry>	<subentry>Technology Consulting (TC)</subentry></servicegroup>

and the code which searches for the text could perform this on each filter: - if there are sub entries, do a "where" on each sub entry's value- if there are no sub entries, do a "where" on the single value

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...