Topic
  • 7 replies
  • Latest Post - ‏2012-10-18T17:50:51Z by harishrad
harishrad
harishrad
6 Posts

Pinned topic 1 csv record to multiple occurences in xml ouput

‏2012-09-07T16:35:31Z |
I have a csv file and 1 record in the csv contains the following structure
patient_id,MRN,SSN say with data patient1, 1234, 999999999

Now i want to convert that to an id list in XML and the output should look like
<idList>
<id>
<Number>1234</Number>
<Type>MRN</Type>
</id>
<id>
<Number>1234</Number>
<Type>MRN</Type>
</id>
</idList>

How can i do this, can some one help please. An example of how to do it would be nice
Updated on 2012-10-18T17:50:51Z at 2012-10-18T17:50:51Z by harishrad
  • harishrad
    harishrad
    6 Posts

    Re: 1 csv record to multiple occurences in xml ouput

    ‏2012-09-07T16:41:33Z  
    sorry the output should look like this

    Now i want to convert that to an id list in XML and the output should look like
    <idList>
    <id>
    <Number>1234</Number>
    <Type>MRN</Type>
    </id>
    <id>
    <Number>999999999</Number>
    <Type>SSN</Type>
    </id>
    </idList>
  • ManojBansal
    ManojBansal
    26 Posts

    Re: 1 csv record to multiple occurences in xml ouput

    ‏2012-09-12T06:15:50Z  
    Go this below link and select "Any2XML". It may help you in finding the solution to your query.

    http://pic.dhe.ibm.com/infocenter/wtxdoc/v8r3m0/index.jsp?topic=%2Fcom.ibm.websphere.dtx.td.doc%2Fconcepts%2Fc_type_design_Utilities_for_XML.htm
  • harishrad
    harishrad
    6 Posts

    Re: 1 csv record to multiple occurences in xml ouput

    ‏2012-09-12T13:07:04Z  
    Go this below link and select "Any2XML". It may help you in finding the solution to your query.

    http://pic.dhe.ibm.com/infocenter/wtxdoc/v8r3m0/index.jsp?topic=%2Fcom.ibm.websphere.dtx.td.doc%2Fconcepts%2Fc_type_design_Utilities_for_XML.htm
    Manoj,

    appreciate your answer. i looked it up and did follow the steps to create the map generated by this any2xml process.
    However the input its expecting is a xml but my input is a flat delimited structure.

    what am i missing?

    thanks
  • harishrad
    harishrad
    6 Posts

    Re: 1 csv record to multiple occurences in xml ouput

    ‏2012-09-17T11:44:42Z  
    Experts, Is there another way, my post is sitting out there for 2 weeks and i got this Any2XML but for some reason its still not working. any examples please
  • lanapoli
    lanapoli
    68 Posts

    Re: 1 csv record to multiple occurences in xml ouput

    ‏2012-09-17T13:45:25Z  
    • harishrad
    • ‏2012-09-17T11:44:42Z
    Experts, Is there another way, my post is sitting out there for 2 weeks and i got this Any2XML but for some reason its still not working. any examples please
    Define an input record defined with patientID, MRN, SSN fields. Create a schema for your output to match the desired format of XML. On idList group, use a functional map to pass in each input record. The idList group in schema would have id element with minOccurs 0 and maxOccurs 2. Expand these instances in the tree and in the first one map the MRN data and use a constant MRN for type and in the 2nd one map the SSN data and use a constant SSN for type.
  • repanzer1
    repanzer1
    114 Posts

    Re: 1 csv record to multiple occurences in xml ouput

    ‏2012-09-18T20:14:47Z  
    I guess I don’t understand exactly what you are asking.

    You say you have an input csv file and want to convert it to an XML file for your output. This the premise of a basic map set up and you would need to know the basics of WTX to achieve it, such as creating the type trees (formats of the input and output) and doing the actual mapping. Are you asking how to do that? If so, that is like going to a Visual Basic message board and saying; “I want a screen for users to input data to and have it populate a database, how do I do that?”. You would need to know how to use Visual Basic to do that. Have you built a map before in WTX?

    There are 10 types of people in this world. Those who understand binary and those who don't.
  • harishrad
    harishrad
    6 Posts

    Re: 1 csv record to multiple occurences in xml ouput

    ‏2012-10-18T17:50:51Z  
    Thanks