Changing an element name when the same name is used in multiple places for different things.

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have to parse an XML feed from a database that uses the term "record" in multiple levels of the xml. I have looked at the xsl:template method but am having trouble seeing how to apply it to my situations. Below is an abbreviated version of
the xml I am receiving. The real value has many more fields in each record. Thanks for any help you may be able to provide.

<span style="font-size:small
<?xml version="1.0" encoding="UTF-8"?><br/>
<_data9999_evaluation_worksheet_live><br/>
<record><br/>
<ID>7</ID><br/>
<PARENT_RECORD_ID>0</PARENT_RECORD_ID><br/>
<todays_date>Thu Aug 16 2012 11:40:55 GMT-0700 (PDT)</todays_date><br/>
<USERID>9125122</USERID><br/>
<GROUP_ID>area 4</GROUP_ID><br/>
<purposeful_community><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>7</PARENT_RECORD_ID><br/>
<MODIFIED_DEVICE_ID>c8ba209ec0484359542f45bbafe4c8e0484bc560</MODIFIED_DEVICE_ID><br/>
<affirmation><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<comments /><br/>
</record><br/>
</affirmation><br/>
<communication><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<utilizes_the_recognition_of_failure_as_an_opportunity_to_improve /><br/>
</record><br/>
</communication><br/>
<culture><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20388</PARENT_PAGE_ID><br/>
</record><br/>
</culture><br/>
<ideals_and_beliefs><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20388</PARENT_PAGE_ID><br/>
<PARENT_ELEMENT_ID>470383</PARENT_ELEMENT_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</ideals_and_beliefs><br/>
<communication3><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</communication3><br/>
<relationship><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<CREATED_BY>9125122</CREATED_BY><br/>
<comments_distinguished2 /><br/>
</record><br/>
</relationship><br/>
<situational_awareness><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20388</PARENT_PAGE_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</situational_awareness><br/>
<visibility><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20388</PARENT_PAGE_ID><br/>
<leverages_communications_among_and_between_stakeholder_groups_to /><br/>
<comments_distinguished2 /><br/>
</record><br/>
</visibility><br/>
</record><br/>
</purposeful_community><br/>
<managing_change><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>7</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20387</PARENT_PAGE_ID><br/>
<affirmation><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</affirmation><br/>
<communication><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20397</PARENT_PAGE_ID><br/>
<is_recognized_in_the_education_community_as_an_advocate_for_new_ /><br/>
<comments_distinguished2 /><br/>
</record><br/>
</communication><br/>
<intellectual_stimulation><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20397</PARENT_PAGE_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</intellectual_stimulation><br/>
<knowledge_of_curriculum_instruction_and_assessment><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20397</PARENT_PAGE_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</knowledge_of_curriculum_instruction_and_assessment><br/>
<monitor_and_evaluate><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20397</PARENT_PAGE_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</monitor_and_evaluate><br/>
<optimize1><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</optimize1><br/>
</record><br/>
</managing_change><br/>
<the_right_focus><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>7</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20387</PARENT_PAGE_ID><br/>
<affirmation><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20404</PARENT_PAGE_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</affirmation><br/>
<communication><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20404</PARENT_PAGE_ID><br/>
<leverages_communications_among_and_between_stakeholder_groups_to /><br/>
<comments_distinguished2 /><br/>
</record><br/>
</communication><br/>
<focus><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20404</PARENT_PAGE_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</focus><br/>
<involvement_in_curriculum_instruction_and_assessment><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<leverages_communications_among_and_between_stakeholder_groups_to /><br/>
<comments_distinguished2 /><br/>
</record><br/>
</involvement_in_curriculum_instruction_and_assessment><br/>
<order123123><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20404</PARENT_PAGE_ID><br/>
<comments_distinguished2 /><br/>
</record><br/>
</order123123><br/>
<order12><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<PARENT_PAGE_ID>20404</PARENT_PAGE_ID><br/>
<contributing_to_improving_student_learning_and_achievement /><br/>
<comments_distinguished2 /><br/>
</record><br/>
</order12><br/>
<outreach1><br/>
<record><br/>
<ID>5</ID><br/>
<PARENT_RECORD_ID>5</PARENT_RECORD_ID><br/>
<leverages_communications_among_and_between_stakeholder_groups_to /><br/>
<comments_distinguished2 /><br/>
</record><br/>
</outreach1><br/>
</record><br/>
</the_right_focus><br/>
</record><br/>
</_data9999_evaluation_worksheet_live>


View the full article
 
Back
Top