[resolved] tXmlMap Find node based on attribute value

One Star

[resolved] tXmlMap Find node based on attribute value

I'm not very familiar with XML.  I've been using tXmlMap to parse a response coming from a tRestClient into a database.

There is an array within the xml that contains multiple values I need to include.  Everything else maps across just fine, no problem.

We have a couple custom fields that the attribute "name" determines what the custom field is.  I need to be able to extract both the "job number" and "customer name" into a CSV output.  I don't think this is a loop since i need both custom_fields.
How do I structure the document so I can pull out both?  Should I be using a different component than a tXmlMap?

XML Structure
<issue>
<id>7774</id>
<project id="106" name="Data Management"/>
<tracker id="1" name="Bug"/>
<status id="7" name="Backlog"/>
<priority id="2" name="Normal"/>
<author id="60" name="Steven Baer"/>
<parent id="7773"/>
<subject>Subtask1</subject>
<description></description>
<start_date>2016-02-27</start_date>
<due_date/>
<done_ratio>0</done_ratio>
<is_private>false</is_private>
<estimated_hours/>
<custom_fields type="array">
<custom_field id="1" name="Job Number">
<value>25735</value>
</custom_field>
<custom_field id="2" name="Company Name">
<value>Test Company 1</value>
</custom_field>
</custom_fields>
<created_on>2016-02-27T10:13:45Z</created_on>
<updated_on>2016-02-27T10:13:45Z</updated_on>
<closed_on/>

</issue>

Trying to output to:
Id, CompanyName, ProjectName, ProjectId, JobNumber, Subject, Description, AuthorId, AuthorName, etc.
7774, Test Company 1, Data Management, 106, 25735, Subtask1, , 60, Steven Baer
One Star

Re: [resolved] tXmlMap Find node based on attribute value

Hello sbaer,
You can use tExtractXMLField to do in your job.
One Star

Re: [resolved] tXmlMap Find node based on attribute value

The tExtractXMLField worked perfectly.
I wish you could do this within the tXMLMap component because I have some additional functions and cleanup I need to run once I extract the XML fields.  Would have been nice to just do that on the right side of the tXMLMap.  But I'll just pass this into another Map or JavaRow and make it work there.
Thanks for your help.  Much appreciated.