This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Converting attributes into child elements


Thanks to Steve Muench, David Carlisle and Mike Kay for your help.

The test transformation works well, I just need to manage/format the 
white space to make the data more legible.

<!-- xml file -->

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="attributes.xsl"?>

<contactInfo>
  <person fname="John" lname="Doe" address="123 Main Street" 
city="Princeton" zipcode="08800"></person>
  <person fname="John" lname="Doo" address="456 Main Street" 
city="Trenton" zipcode="08801"></person>
  <person fname="John" lname="Doh" address="789 Main Street" 
city="Jamesburg" zipcode="08802"></person>
</contactInfo> 

<!-- xsl file -->

<xsl:stylesheet 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
<xsl:template match="person">
<xsl:copy>
<xsl:for-each select="@*">
<xsl:element name="{name()}"><xsl:value-of select="."/></xsl:element>
</xsl:for-each>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


---------------------------------------------
This message was sent using MI-Webmail.
No matter where you are, never lose touch.
Get your Email using MI-Webmail.
http://www.monmouth.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]