p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   XSLT (http://p2p.wrox.com/xslt-86/)
-   -   sequenced elements to attributes (http://p2p.wrox.com/xslt/41470-sequenced-elements-attributes.html)

zkent April 19th, 2006 08:50 AM

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



All times are GMT -4. The time now is 01:16 PM.

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