Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8966657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:04:06+00:00 2026-06-15T17:04:06+00:00

I got an XML file that’s using very generic XML tag names but a

  • 0

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 &amp; Refrigeration</FormattedValue><Value>Heating, A/C &amp; 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 &amp; Physiology</FormattedValue><Value>Anatomy &amp; 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>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:04:07+00:00Added an answer on June 15, 2026 at 5:04 pm

    This would work…

    XML Input (corrected to be well-formed)

    <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 &amp; Refrigeration</FormattedValue>
                        <Value>Heating, A/C &amp; 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/>
                        <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 &amp; Physiology</FormattedValue>
                        <Value>Anatomy &amp; 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>
    

    XSLT 1.0

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output indent="yes"/>
        <xsl:strip-space elements="*"/>
    
        <xsl:template match="@*|node()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
    
        <xsl:template match="Field[@Name]">
            <xsl:element name="{@Name}">
                <xsl:value-of select="FormattedValue"/>
            </xsl:element>
        </xsl:template>
    
    </xsl:stylesheet>
    

    XML Output

    <CrystalReport>
       <ReportHeader>
          <Details Level="1">
             <Section SectionNumber="0">
                <CRSDESC1>Heating and Air Contracting</CRSDESC1>
                <CRSTITLE1>Heating and Air Conditioning Contracting</CRSTITLE1>
                <CRSDEPTS1>AIRC</CRSDEPTS1>
                <DEPTSDESC1>Heating, A/C &amp; Refrigeration</DEPTSDESC1>
                <CRSNO1>2260</CRSNO1>
                <CRSSTANDARDARTICULATIONNO1/>
                <CRSMINCRED1>3.00</CRSMINCRED1>
             </Section>
          </Details>
          <Details Level="1">
             <Section SectionNumber="0">
                <CRSDESC1>Survey of Human Anatomy and Physiology</CRSDESC1>
                <CRSTITLE1>Survey of Human Anatomy and Physiology</CRSTITLE1>
                <CRSDEPTS1>ANAT</CRSDEPTS1>
                <DEPTSDESC1>Anatomy &amp; Physiology</DEPTSDESC1>
                <CRSNO1>1500</CRSNO1>
                <CRSSTANDARDARTICULATIONNO1>L1 904L</CRSSTANDARDARTICULATIONNO1>
                <CRSMINCRED1>4.00</CRSMINCRED1>
             </Section>
          </Details>
       </ReportHeader>
    </CrystalReport>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this XML file that I am parsing using the parser here and
I've got an XML data file that I'm applying an XSL stylesheet to, using
I've got a PHP page that parses an XML file with SimpleXml, then passes
I've got some routines in an XSLT stylesheet that process an XML file to
I've got an xml file that looks like this: <Records> <Record> <table> <Row> <col1>value1</col1>
Crux of my problem: I've got an XML file that returns 20 results. Within
I got an XML file from 3rd party that I must import in my
I've got a fairly big XML file that I need to parse into a
I have a very large XML file that I need to parse so I
I got an XML file that is 9MB large. Apparently, it is broken. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.