Link to home
Start Free TrialLog in
Avatar of bachra04
bachra04Flag for Canada

asked on

help needed with XSLT

Hi Experts I m new with XSLT and need some help.
First of all how do I test my XSLT and XML using the browser ?

My next question is that I have the following XML file
<?xml version="1.0" encoding="ISO-8859-1"?>
<horaire_session>
  <session>
    <annee>2012</annee>
    <numero>1</numero>
  </session>
  <cours_offert>
    <sigle>INF4163</sigle>
    <seance type="cours">
      <groupe>01</groupe>
      <jour>mar</jour>
      <debut>
        <h>08</h>
        <m>30</m>
      </debut>
      <fin>
        <h>11</h>
        <m>30</m>
      </fin>
    </seance>
    <seance type="TD">
      <groupe>01</groupe>
      <jour>jeu</jour>
      <debut>
        <h>15</h>
        <m>45</m>
      </debut>
       <fin>
        <h>11</h>
        <m>30</m>
      </fin>
      </seance>
  </cours_offert>
</horaire_session>

Open in new window


I need two XSLT transformation :

- One to add an element to that file
- One to remove an element from that file

Thanks
Avatar of darjimaulik
darjimaulik
Flag of India image

Hi,

Answer to First,
One of the best and FREE software to test your XML and XSLT is XMLPad

http://www.wmhelp.com/xmlpad3.htm 

This can display the output in Browser too.

Second,
Clarification
XSLT is used to "Display" the XML and not edit the XML.
So you can not Add or Remove the Elements in the XML.

But yes if you want to "Display" Some XML node using a condition, you can do that.
Avatar of bachra04

ASKER

what about this link :
addin new element to XML
ASKER CERTIFIED SOLUTION
Avatar of darjimaulik
darjimaulik
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
basically I have the following :

- input XML file : contains list of all courses --> "allCourses.xml"
-output XML file : contains a list of selected courses  --> "SelectedCourses.xml"

so whenever the user selects a course name and type this course is added to the selected courses xml file. ("SelectedCourses.xml").
this list will be displayed within a list inside a HTML page.
Whenever the user selects a course from this list and click delete the course will be removed from SlectedCourses.xml
it was helpful but not enough to solve the problem.