From the above xml tag i need to extract the “desc” attribute and the body content and map it into string list. The main tag dec_pol might will contain a max of 8 cd_rsn_pol tags. Pleas help me in the above.i queried the above xml using queryXML service and converted it into a doc of which will coontain cd_rsn_pol documents in below format:
@seq : 1 @desc: Failed CutOff-Cat 4 *body: R324 Kindly help me in extractin the desc and body values and map it into a string list.Its very urgent pls.
You can just convert the xml string to IS document using the built in XML services. Refer the Build-in service reference guide. The resulting document will have the exact structure of the XML with cd_rsn_pol as document list. You can then just map the @desc and *body to your list.
I did tried that way to convert it to docuement of below structure.
cd_rsn_pol(docuement List)
cd_rsn_pol 1 (docuemnt) @seq : @desc :
body:
Since the cd_rsn_pol might contain more than one element i created a document list of above structure and i am able to get the data in IS document format. But when i map the @desc and body to 2 seperate string list it s showing null values :mad:… Not sure why this is coming like this.
Should i use a loop while mapping as it is document list…Kindly advise.
I would suggest first to use a loop over the document list that you created. Step in to the service and see whether it enters the loop or not. I suspect it wont enter the loop as there might be somethign wrong when you mapped the output of the nodetoDocument service to your document.
If it enters then compare the path (e.g: dec_pol/cd_rsn_pol[0]/@desc) of the @desc variable from the pipeline of the map step to the actual runtime pipeline at that point in time. My second bet, they wont match.
There is already a post for a similar issue here in this forum.
I jus removed the loop and converted the docuement to an XML node and queried it.
The results were mapped direclty to a string list and i am gettin the expected output.