Solved

help needed with XSLT

Posted on 2012-03-28
5
201 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now