Jump to content

[xslt] Group Tags To Prioritize The Xml File


sacha74

Recommended Posts

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...