Solved

xml to xml transformation does not work

Posted on 2009-07-14
5
417 Views
Last Modified: 2013-11-18
hi all,
I'm working on linux version 5 with xampp and trying to transform xml document to another xml document on the fly using xsl
my but it does not work can you please make it work for me the code  is attached when I view source I find the original xml format which means the document not transformed

please help
xml.zip
0
Comment
Question by:hatem_from_mesr
  • 3
  • 2
5 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24848599
Let me start by saying that there is nothing wrong with your XSLT,

I assume that you are looking at the result in a browser.
Well, if you then view source, you will actually see the source, not the transformation result.
The original XML is regarded the "source" in view source, not th etransformation result

If you want to view the result in a browser, you will have to make the result html instead of XML
or rserve the transformation result with a mimetype XML

You are better off using a command line XSLT to get a physical result
and after that, you could view that result XML in a browser, if you want to
0
 

Author Comment

by:hatem_from_mesr
ID: 24848673
>>>>If you want to view the result in a browser, you will have to make the result html instead of XML
>>>>or rserve the transformation result with a mimetype XML
can you guide me how to do that

>>>>You are better off using a command line XSLT to get a physical result
>>>>and after that, you could view that result XML in a browser, if you want to
can you guide me how to do that too

best regards
hatem gamal
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24848737
serving:
get yourself a webserver,
do the transformation server side
and feed the result XML with the XML mimetype
If you havent't done this before, pick the other way

command line:
get yourself a linux distribution of an XSLT processor
(can't help you too much, since I am not a linux user)
I suggest you download Saxon B (http://saxon.sourceforge.net/)
Make sure you have a java virtual machine
and your command line will likely be something like this
java -jar saxon9.jar xml-file-name xslt-file-name -o result-file-name
please check the docs for that
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 24848805
0
 

Author Comment

by:hatem_from_mesr
ID: 24857943
do you have any idea why that error  appears
[root@lamiayassein saxonsa9-1-0-7j]# java -jar saxon9.jar -t -s:letter-text.xml -xsl:letter2xml.xsl -o:out.xml
Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/ext/DefaultHandler2
        at net.sf.saxon.Configuration.<clinit>(Configuration.java:2047)
        at net.sf.saxon.Transform.setFactoryConfiguration(Transform.java:81)
        at net.sf.saxon.Transform.doTransform(Transform.java:133)
        at net.sf.saxon.Transform.main(Transform.java:66)
[root@lamiayassein saxonsa9-1-0-7j]#

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

762 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

19 Experts available now in Live!

Get 1:1 Help Now