I got an XML file that's using very generic XML tag names but a rich attribute structure such as:
<Field Name="CRSDESC1" FieldName="{@CRS_DESC}"><FormattedValue>Survey of Human Anatomy and Physiology</FormattedValue></Field>
I want to change the existing element name as shown above by using the "Name" attribute, to this:
<CRSDESC1>Survey of Human Anatomy and Physiology</CRSDESC1>
Once we create the new element, we no longer need the element <FormattedValue> nor the duplicate <Value>
Here is a sample section of the XML:
<CrystalReport> <ReportHeader><Details Level="1">
<Section SectionNumber="0">
<Field Name="CRSDESC1" FieldName="{@CRS_DESC}"><FormattedValue>Heating and Air Contracting</FormattedValue><Value>Heating and Air Contracting</Value></Field>
<Field Name="CRSTITLE1" FieldName="{@CRS_TITLE}"><FormattedValue>Heating and Air Conditioning Contracting</FormattedValue><Value>Heating and Air Conditioning Contracting</Value></Field>
<Field Name="CRSDEPTS1" FieldName="{Command.CRS_DEPTS}"><FormattedValue>AIRC</FormattedValue><Value>AIRC</Value></Field>
<Field Name="DEPTSDESC1" FieldName="{Command.DEPTS_DESC}"><FormattedValue>Heating, A/C & Refrigeration</FormattedValue><Value>Heating, A/C & Refrigeration</Value></Field>
<Field Name="CRSNO1" FieldName="{Command.CRS_NO}"><FormattedValue>2260</FormattedValue><Value>2260</Value></Field>
<Field Name="CRSSTANDARDARTICULATIONNO1" FieldName="{Command.CRS_STANDARD_ARTICULATION_NO}"><FormattedValue></FormattedValue><Value></Value></Field>
<Field Name="CRSMINCRED1" FieldName="{Command.CRS_MIN_CRED}"><FormattedValue>3.00</FormattedValue><Value>3.00</Value></Field>
</Section>
</Details>
<Details Level="1">
<Section SectionNumber="0">
<Field Name="CRSDESC1" FieldName="{@CRS_DESC}"><FormattedValue>Survey of Human Anatomy and Physiology</FormattedValue><Value>Survey of Human Anatomy and Physiology</Value></Field>
<Field Name="CRSTITLE1" FieldName="{@CRS_TITLE}"><FormattedValue>Survey of Human Anatomy and Physiology</FormattedValue><Value>Survey of Human Anatomy and Physiology</Value></Field>
<Field Name="CRSDEPTS1" FieldName="{Command.CRS_DEPTS}"><FormattedValue>ANAT</FormattedValue><Value>ANAT</Value></Field>
<Field Name="DEPTSDESC1" FieldName="{Command.DEPTS_DESC}"><FormattedValue>Anatomy & Physiology</FormattedValue><Value>Anatomy & Physiology</Value></Field>
<Field Name="CRSNO1" FieldName="{Command.CRS_NO}"><FormattedValue>1500</FormattedValue><Value>1500</Value></Field>
<Field Name="CRSSTANDARDARTICULATIONNO1" FieldName="{Command.CRS_STANDARD_ARTICULATION_NO}"><FormattedValue>L1 904L</FormattedValue><Value>L1 904L</Value></Field>
<Field Name="CRSMINCRED1" FieldName="{Command.CRS_MIN_CRED}"><FormattedValue>4.00</FormattedValue><Value>4.00</Value></Field>
</Section>
</Details> <ReportHeader><CrystalReport>