XML : XSLT split into multiple HTML files

I'm quite a beginner with XSLT and I would like to split an XML file into multiple HTML files according to a specific attribute that is in the XML file.

Here is a sample of my XML file :

  <article>  <div>  <paragraph>text text text</paragraph>  </div>  <div class="zoologie">  <def>this is a definition</def>  <def>this is another definition</def>  <example>this is a first example</example>  <example>this is a second example</example>  </div>  </article>    <article>  <div>  <paragraph>text text text</paragraph>  </div>  <div class="médecine">  <def>this is a definition</def>  <def>this is another definition</def>  <example>this is a first example</example>  <example>this is a second example</example>  </div>  </article>    <article>  <div>  <paragraph>text text text</paragraph>  </div>  <div class="zoologie">  <def>this is a definition</def>  <def>this is another definition</def>  <example>this is a first example</example>  <example>this is a second example</example>  </div>  </article>    

What I would like to obtain is one HTML file that group togheter all articles with the same attribute class. For instance, one HTML file named zoologie.html that gather all the articles containing the attribute class="zoologie". And another HTML file named médecine.html that gather all articles with the attribute class="médecine". I have tried something with the split function but it won't work. I'd be grateful if you could help me with this. Thanks, Flo

No comments:

Post a Comment