Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 19th, 2006, 09:50 AM
Registered User
 
Join Date: Sep 2004
Location: , VT, .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default sequenced elements to attributes

#1 I use Mapforce for most XSLT and am not good at hand-coding them
#2 I have searched for this for days
#3 I have been attempting to make it work for days

I have a series name-value pairs of elements that I need sequenced into attributes. The element names are ADDRESS1, CITY1, STATE1, ZIP1, ADDRESS2, CITY2, STATE2, etc. The name value pairs are not in order either.

I have this
======================
Code:
<PROPERTIES>
  <PROPERTY>
    <PROPERTYKEY>ADDRESS1</PROPERTYKEY>
    <PROPERTYVALUE>123 Anyold Street</PROPERTYVALUE>
  </PROPERTY>
  <PROPERTY>
    <PROPERTYKEY>ADDRESS2</PROPERTYKEY>
    <PROPERTYVALUE>567 Long Blvd</PROPERTYVALUE>
  </PROPERTY>
  <PROPERTY>
    <PROPERTYKEY>CITY1</PROPERTYKEY>
    <PROPERTYVALUE>MARYLAND HEIGHTS</PROPERTYVALUE>
  </PROPERTY>
  <PROPERTY>
    <PROPERTYKEY>CITY2</PROPERTYKEY>
    <PROPERTYVALUE>Jacksonville</PROPERTYVALUE>
  </PROPERTY>
  <PROPERTY>
    <PROPERTYKEY>CITY3</PROPERTYKEY>
    <PROPERTYVALUE>Some City</PROPERTYVALUE>
  </PROPERTY>
  <PROPERTY>
    <PROPERTYKEY>ADDRESS3</PROPERTYKEY>
    <PROPERTYVALUE>876 Pine Street</PROPERTYVALUE>
  </PROPERTY>
</PROPERTIES>
And I want this
=========================

Code:
<PROPERTY Sequence="1" Address="123 Anyold Street" City="MARYLAND HEIGHTS"/>
<PROPERTY Sequence="2" Address="567 Long Blvd" City="Jacksonville"/>
<PROPERTY Sequence="3" Address="876 Pine Street" City="Some City"/>
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
remove empty elements but not ones with attributes dupdup XSLT 1 March 3rd, 2007 07:02 PM
how to control optional elements and attributes NEO1976 XSLT 5 September 4th, 2006 03:58 AM
Elements and attributes Morrislgn XSLT 1 June 20th, 2005 12:13 PM
Help:Recursive Function - attributes into elements spencer.clark XSLT 1 June 10th, 2005 08:56 AM
Elements w same name and their attributes supafly XSLT 1 May 30th, 2005 07:34 AM



All times are GMT -4. The time now is 08:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.