473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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

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

Similar topics

6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
4
by: Chris Kettenbach | last post by:
Hi Peter, I get error when processing the stylesheet. It errors here. <xsl:for-each select="registration)=1]"> specifically: Expression does not return a DOM node. registration)=1]<--
5
by: dennis | last post by:
Hi, First of all, hi to you all. I'm working on a Delphi project wich is becoming near it's deadline. I have a very simple XSLT question wich i hope one of you folks can help me with? The...
5
by: | last post by:
Hello Guys, I am trying to render an Xml dataset into HTML using XSLT. When I am loading the XSLT file into transform object to render it. Here is the code snippet: <!-- XslTransform...
7
by: Roshawn Dawson | last post by:
Hi, I have an xslt file located in the root directory. It is used by an aspx pages in both the root directory and a subdirectory. But for some strange reason, the aspx page in the subdirectory...
1
by: byquestion | last post by:
Hi there xslt gurus, i am kinda new to xslt and having difficulty to implement my some iterations. i need to recreate an xml file by using xslt. here is the sample xml file(input for xslt) ...
6
Gaiason
by: Gaiason | last post by:
Hi XML/XSLT masters and gurus, I am a newbie in XML/XSLT and have been reading up XML/XSLT in order to convert a XML generated from a OCR engine to another format of XML. I am truly stuck at this...
2
by: milecimm | last post by:
Hello, I need some help to solve the following problem (if it is possible, that's it): I'm using a xpath expression to programatically get data from my xml file. I want to transform ONLY the...
4
by: Nick | last post by:
I have a critical requirement where I need to club together 4 xml files and display them in an sibngle HTML report. The xmls are generated by Java application by a normal file I/O. Is there a...
2
Dormilich
by: Dormilich | last post by:
Hi, I'm testing my classes for a web page and I stumble upon an error I don't have a clue what it means: Error: Fatal error: Can't use method return value in write context in "output.php" on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.