Solved

help needed with XSLT

Posted on 2012-03-28
5
203 Views
Last Modified: 2012-04-21
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
0
Comment
Question by:bachra04
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:darjimaulik
ID: 37776069
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.
0
 
LVL 2

Author Comment

by:bachra04
ID: 37776088
what about this link :
addin new element to XML
0
 
LVL 9

Accepted Solution

by:
darjimaulik earned 500 total points
ID: 37776119
Correct!


You can not add or Edit XML.
But yes if you want to "Display" Some XML node using a condition, you can do that.

XSLT is basically manipulation of the XML.

You give XML as Input and you get XML or HTML as output.

Let me know what kind of condition you want to check where you want to add or delete the Node.
0
 
LVL 2

Author Comment

by:bachra04
ID: 37776147
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
0
 
LVL 2

Author Closing Comment

by:bachra04
ID: 37876156
it was helpful but not enough to solve the problem.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question