473,396 Members | 1,893 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,396 software developers and data experts.

Problem with xml with duplicate tags

1
I need to create a xls transform for the xml below that would put the items into a table format:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
  2. <doc>
  3.   <items>
  4.      <item>a</item>
  5.      <item>b</item>
  6.      <item>c</item>
  7.      <item>d</item>
  8.   </items>
  9.   <items>
  10.      <item>1</item>
  11.      <item>2</item>
  12.      <item>3</item>
  13.      <item>4</item>
  14.   </items>
  15. </doc>
table would be like:

Expand|Select|Wrap|Line Numbers
  1. <table>
  2. <tr>
  3. <td>a</td>
  4. <td>b</td>
  5. <td>c</td>
  6. <td>d</td>
  7. </tr>
  8. <tr>
  9. <td>1</td>
  10. <td>2</td>
  11. <td>3</td>
  12. <td>4</td>
  13. </tr>
  14. </table>
Is something like this possible?
May 7 '10 #1
2 2197
Dormilich
8,658 Expert Mod 8TB
sure, this is possible. basicly it’s about copy & replace.
May 7 '10 #2
jkmyoung
2,057 Expert 2GB
Eg, example:
Expand|Select|Wrap|Line Numbers
  1. <xsl:template match="nodeToReplace">
  2.   <newNode>
  3.     <xsl:apply-templates/>
  4.   </newNode>
  5. </xsl:template>
Write a template for each node you want to replace, changing 'nodeToReplace' and 'newNode' with the respective node names.
May 7 '10 #3

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

Similar topics

2
by: steve | last post by:
I need html tags in my forum pages to show up, but not to be active. I have tried to change the tags to html equivalent code using php, but still they are active. How do I go about chaning them...
3
by: echoharger | last post by:
Hello, I have two XML files. File#1 has a namespace. File#2 does not. I am storing some XML from File#1 in File#2, therefore, the node has a namespace attribute. Later, I remove the node...
18
by: Robert Bowen | last post by:
Hello peeplez. I have an odd problem. When I put the ANSI symbol for "less than" ("<"), the word STRONG and then the ANSI symbol for "greater than" (">") in my web page, followed by some text, then...
0
by: deacon57 | last post by:
FYI - If you are a computer scientist (or geek), this post may be for you. I wanted to log any search keywords, etc that are used on my site. I created a simple program that logs search terms...
1
by: gaikokujinkyofusho | last post by:
Hi, I have been enjoying being able to subscribe to RSS (http://kinja.com/user/thedigestibleaggie) for awhile and have come up with a fairly nice list of feeds but I have run into an annoying...
0
by: futnuh | last post by:
I am having exactly the same issue as this poster back in 2005. It's strange behaviour where libraries are being automatically appended to my "additional dependencies". In the following linker...
2
by: mgriggs13 | last post by:
I have researched the jist behind making this work but I am having a unique problem that I can't seem to fix. I use the following code to grab the text between these two tags. $content =...
26
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any...
7
by: miladhatam | last post by:
hi friends i've built a page that should show first 150 chars of every of my topics but when i wanted to do this work with SubString() it included the tags of my field of my db and very bad...
1
by: dreamy | last post by:
can i ask how to solve the problem Duplicate entry '0' for key 1? thz
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.