Results 1 to 2 of 2

Thread: Using XSL to remove attributes?

  1. #1

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Using XSL to remove attributes?

    How can I transform
    PHP Code:
    <Employee date_of_birth="1977-12-01" first_names="Karl" gender="Male" middle_name="Heinrich" name="Karl Marx" employee_no="2011" reference="KM_000123" /> 
    to
    PHP Code:
    <Employee date_of_birth="1977-12-01" first_names="Karl" gender="Male" middle_name="Heinrich" name="Karl Marx" reference="KM_000123" /> 
    ?

    Can this be done using XSL?
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Using XSL to remove attributes?

    Code:
    <xsl:template match="Employee">
    	<Employee>
    		<xsl:attribute name="date_of_birth">
    			<xsl:value-of select="@date_of_birth" />
    		</xsl:attribute>
    		<xsl:attribute name="first_names">
    			<xsl:value-of select="@first_names" />
    		</xsl:attribute>
    		<!-- etc. -->
    	</Employee>
    </xsl:template>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width