Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > Other Programming Languages
|
Other Programming Languages If you have a coding issue to discuss about another language that really isn't provided for in any other forum here (not ASP.NET C#, C++, VB, PHP, JavaScript, Python, Java, Perl, Applescript, XML or any of the other forum topics we have), post it here. Enough discussion on a language we don't have covered could prompt a new forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Other Programming Languages 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
  #1 (permalink)  
Old September 21st, 2009, 05:10 AM
Registered User
 
Join Date: Sep 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default [XSLT] Group tags to prioritize the xml file

Hello,

I have 2 problems with an xml file:

1. the original xml has no structure because all the tags (except the root element) are at the same level. What I want to do is to insert a tag <toto>, whose children would be one <FM1Titre> and all the tags that follow it until the next tag <FM1Titre>.

2. I would like to report the content of the tag FM1Titre as the name of the tag that I have mentionned above.

Here is a part of the xml file:

<XML>
<FM1Titre>Description </FM1Titre>
<Bloc-paragraphe>La table mère permet de paramétrer les tables. </Bloc-paragraphe>
<Bloc-paragraphe>Toute nouvelle table doit être créée en premier lieu dans la table mère.</Bloc-paragraphe>

<FM1Titre>Détails techniques </FM1Titre>
...</XML>

What I would like to obtain after transformation :

<XML>
<Description>
<FM1Titre>Description </FM1Titre>
<Bloc-paragraphe>La table mère permet de paramétrer les tables. </Bloc-paragraphe>
<Bloc-paragraphe>Toute nouvelle table doit être créée en premier lieu dans la table mère.</Bloc-paragraphe>
</Description>

<Détails techniques>
<FM1Titre>Détails techniques </FM1Titre>
</Détails techniques>

...</XML>
My researches have been unsuccessful (research on the net, on proposed solutions on the forum) and I begin to think that it is maybe impossible to do that with XSLT 1.0.
I use to find a solution to problem of that kind but this time I do not manage to find an answer by myself, so if anyone could have a solution or a track, please help me...

Thanks in advance.
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifiying XML File using XSLT brianlan XSLT 1 October 2nd, 2007 03:14 PM
Replacing tags within xml using xslt patelgaurav85 XSLT 0 June 19th, 2007 12:34 PM
XSLT help : Interpretting HTML tags from XML kunal_kishan XSLT 1 June 26th, 2006 05:37 AM
merge two xml file and make new xml using xslt ketan XSLT 0 September 21st, 2004 08:48 AM
Merge XML files into a xml file using xslt lxu XML 4 November 6th, 2003 06:01 PM





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