[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Converting attributes into child elements

Subject: RE: Converting attributes into child elements
From: jlangdon@xxxxxxxxxxxx
Date: Mon, 13 Nov 2000 10:38:49 EDT
xslt attribute to child
> > The test transformation works well, I just need to manage/format the 
> > white space to make the data more legible.
> 
> Does <xsl:output indent="yes"> do the job?
> 
> Mike Kay 

Yes. I also used <xsl:strip-space elements="*"/> as you can see by the 
code.  I would like to take the attributes that were transformed into 
child elements and lay them out in a column format.  Suggestions?  Do I 
combine the xsl file with some html/css to achieve this?

Thanks again Mike.

Regards,

Jeff Langdon

<!-- 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:strip-space elements="*"/>
<xsl:output indent="yes"/>
<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>




---------------------------------------------
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.