0

I am trying to edit an xml document using xslt. I need to transform an XML file into an editable HTML form using XSLT and then the changes made by the user in the HTML form should be reflected in the XML file.I found this tutorial which does that. http://www.w3schools.com/xsl/xsl_editxml.asp

But the problem is i don't have IIS installed and need to do this without using IIS. So is there any other way of editing XML using XSLT without using IIS?

Aditi
  • 1,188
  • 2
  • 16
  • 44
  • possible duplicate of [Are there any xslt processing command line tools?](http://stackoverflow.com/questions/6527112/are-there-any-xslt-processing-command-line-tools) – Ignacio Vazquez-Abrams Oct 01 '12 at 05:51
  • i don't want a processing tool... – Aditi Oct 01 '12 at 08:45
  • 1
    You need to be more specific and provide a complete (, but small) example. Something must take the user's changes (for example Javascript code) and invoke a second XSLT transformation passing it as parameters the changes, so that the transformation can produce the final XML document. The same agent (javascript) would most probably invoke the first transformation so that it would produce the Html form from the initial XML document. – Dimitre Novatchev Oct 01 '12 at 12:50

3 Answers3

1

If I understood you correctly, you are simply looking for a way to use an XSLT processor without having to use IIS (or another web server with added support for this feature). There are quite a few ways you can test XSLT transformations without having to install any software at all. A ton of different web pages will transform XML for you (given your XSLT and target XML). To name a few:

  1. http://www.xmlper.com/
  2. http://www.online-toolz.com/tools/xslt-transformation.php

These online tools, though, normally utilize processors that conform to the XSLT 1.0 standard. This means that if you're planning on using XPath functions/other such rich features, you'll be better of downloading an IDE that specifically supports XSLT 2.0 transformations.

Commercial products include Visual Studio, Altova's XML Spy etc.

I'm not too familiar with freeware products in this case, but I think you can also try using Netbeans IDE with the "XML tools plugin". (In case of using Netbeans: if you need XSLT 2.0 support, you will probably have to configure it to use a Saxon processor(supports XSLT2.0) instead of the default Xalan processor(supports XSLT1.0)).

EDIT: As Ignacio pointed out, there's obviously a plethora of ways to transform XSLT using command-line tools. My aim in this answer was at visual transformators, as I find these to be more beginner-friendly.

Priidu Neemre
  • 2,813
  • 2
  • 39
  • 40
  • Actually what i need is to do is... transform an XML file into an editable HTML form using XSLT and then the changes made by the user in the HTML form should be reflected in the XML file. – Aditi Oct 01 '12 at 06:19
1

How about using a three line Powershell script:

$xsl = New-Object -TypeName System.Xml.Xsl.XslCompiledTransform
$xsl.Load("stylefile.xsl")
$xsl.Transform("xmlfile.xml", "newfile.html")
Dave Sexton
  • 10,768
  • 3
  • 42
  • 56
  • I think the question is not just how to execute the transformation, but also how to run the resulting form and then apply the input back to the XML. – MiMo Dec 07 '12 at 14:08
1

If I understand correctly, you need to execute a XSLT transformation on some XML, present to the user the resulting HTML form or editable HTML, collect the user input in such form (or the changes to the HTML) and convert them back to changes in the XML.

To do these things you need an XSLT processor and a way to execute a HTML form with some associated code. You can do these things with any Web browser - you don't need any server component like IIS. A stand-alone HTML page can contain all the necessary logic: you open this HTML page in a browser and it does the work.

To be any more specific than this we'll need some more details on the whole process, with some example of the code, the form, the XML etc. (see Dimitre comment).

MiMo
  • 11,793
  • 1
  • 33
  • 48