Solved

help needed with XSLT

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xml attribute DTD attribute differences 3 76
XML file fails to process correctly 3 64
Getting attribute Values using xslt 4 53
XSL-FO - show results in 2 columns 5 32
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…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
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…

856 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