Solved

help needed with XSLT

Posted on 2012-03-28
5
206 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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
VB.Net. Reading xml value 6 36
Add to XML (Powershell) 1 41
parsing xml using powershell 6 33
MS Access VBA Object Variable Not Set. Can't figure this out. 11 43
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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. 
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

679 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