469,336 Members | 6,193 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

help with xslt

I would like help with a simple transformation:

I am the following xml document:

Expand|Select|Wrap|Line Numbers
  1. <Root>
  2.   <FacilitySiteAllDetails>
  3.    <FacilitySite>
  4.       <FacilitySiteID>99999</FacilitySiteID>
  5.       <FacilitySiteTypeName>STATIONARY</FacilitySiteTypeName>
  6.       <FederalFacilityIndicator>N</FederalFacilityIndicator>
  7.       <TribalLandIndicator>N</TribalLandIndicator>
  8.    </FacilitySite>
  9.    <LocationAddress>
  10.       <LocationAddressText>Some Address 1</LocationAddressText>
  11.       <LocalityName>Orlando</LocalityName>
  12.       <CountyStateFIPSCode>09999</CountyStateFIPSCode>
  13.       <CountyName>Orange</CountyName>
  14.       <StateUSPSCode>FL</StateUSPSCode>
  15.       <StateName>Florida</StateName>
  16.       <CountryName>USA</CountryName>
  17.       <LocationZIPCode>888883906</LocationZIPCode>
  18.    </LocationAddress>
  19.   </FacilitySiteAllDetails>
  20.   <FacilitySiteAllDetails>
  21.    <FacilitySite>
  22.       <FacilitySiteID>99999</FacilitySiteID>
  23.       <FacilitySiteTypeName>STATIONARY</FacilitySiteTypeName>
  24.       <FederalFacilityIndicator>N</FederalFacilityIndicator>
  25.       <TribalLandIndicator>N</TribalLandIndicator>
  26.    </FacilitySite>
  27.    <LocationAddress>
  28.       <LocationAddressText>Some Address 2</LocationAddressText>
  29.       <LocalityName>Orlando</LocalityName>
  30.       <CountyStateFIPSCode>08888</CountyStateFIPSCode>
  31.       <CountyName>Apple</CountyName>
  32.       <StateUSPSCode>FL</StateUSPSCode>
  33.       <StateName>Florida</StateName>
  34.       <CountryName>USA</CountryName>
  35.       <LocationZIPCode>999993906</LocationZIPCode>
  36.    </LocationAddress>
  37.   </FacilitySiteAllDetails>
  38. </Root>
  39.  
  40. I would like a xslt to put the 2 records into 1, with 2 addresses:
  41. <Root>
  42.   <FacilitySiteAllDetails>
  43.    <FacilitySite>
  44.       <FacilitySiteName>Towing Service</FacilitySiteName>
  45.       <FacilitySiteTypeName>STATIONARY</FacilitySiteTypeName>
  46.       <FederalFacilityIndicator>N</FederalFacilityIndicator>
  47.       <TribalLandIndicator>N</TribalLandIndicator>
  48.    </FacilitySite>
  49.    <LocationAddress>
  50.       <LocationAddressText>Some Address 1</LocationAddressText>
  51.       <LocalityName>Orlando</LocalityName>
  52.       <CountyStateFIPSCode>09999</CountyStateFIPSCode>
  53.       <CountyName>Orange</CountyName>
  54.       <StateUSPSCode>FL</StateUSPSCode>
  55.       <StateName>Florida</StateName>
  56.       <CountryName>USA</CountryName>
  57.       <LocationZIPCode>888883906</LocationZIPCode>
  58.    </LocationAddress>
  59.    <LocationAddress>
  60.       <LocationAddressText>Some Address 2</LocationAddressText>
  61.       <LocalityName>Orlando</LocalityName>
  62.       <CountyStateFIPSCode>08888</CountyStateFIPSCode>
  63.       <CountyName>Apple</CountyName>
  64.       <StateUSPSCode>FL</StateUSPSCode>
  65.       <StateName>Florida</StateName>
  66.       <CountryName>USA</CountryName>
  67.       <LocationZIPCode>999993906</LocationZIPCode>
  68.    </LocationAddress>
  69.   </FacilitySiteAllDetails>
  70. </Root>
Is it possible with XSLT? What would the xslt look like?
Thanks.
Apr 19 '07 #1
1 900
dorinbogdan
839 Expert 512MB
Welcome to TheScripts TSDN....

Yes, it is possible with XSL.
BUT, we will not provide full source code, it is against the site rules.
We try to help with suggestions and code snippets.
I recommend you this short tutorial, that should take max. 30 minutes to read.

Then, if you need more help, please provide the XSL code to be updated or enhanced as desired.

Thanks,
Dorin.
Apr 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Pete | last post: by
4 posts views Thread by Chris Kettenbach | last post: by
5 posts views Thread by | last post: by
7 posts views Thread by Roshawn Dawson | last post: by
Gaiason
6 posts views Thread by Gaiason | last post: by
Dormilich
2 posts views Thread by Dormilich | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.