Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2006, 08: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"/>




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 02:58 AM
Elements and attributes Morrislgn XSLT 1 June 20th, 2005 11:13 AM
Help:Recursive Function - attributes into elements spencer.clark XSLT 1 June 10th, 2005 07:56 AM
Elements w same name and their attributes supafly XSLT 1 May 30th, 2005 06:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.