aspose file tools
The moose likes XML and Related Technologies and the fly likes Editing XML with XSL ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Editing XML with XSL ?" Watch "Editing XML with XSL ?" New topic
Author

Editing XML with XSL ?

Mark Spencer
Greenhorn

Joined: Feb 02, 2008
Posts: 8
Hi All,
I am pretty new to XML.
Currently I have a XML which I am transforming to HTML (for display purpose - table format) using XSL.
Now what I want. is to allow to change some entries (e.g. comment section) in that table when displayed as HTML and save it to original XML file.
The both files (XML and XSL) are present on same machine and accessed locally.

Can I achieve this with XSL ? or XSL is strictly for displaying the XML data ?
If not only with XSL, what can I use for local (client side) updation ? (I have read this can be achived through ASP etc., but I don't want server code).

Please also provide link to tutorials, if available.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

So you have an XSLT which transforms an XML document to HTML.

And now you want to change it so it also modifies the original document?

Okay. You can't do that with XSLT 1.0, as it can only output to one target. (Although there are proprietary extensions from various XSLT 1.0 implementations which allow you to output to more than one target.) If you want to use XSLT 2.0 -- which isn't bundled into the standard Java API -- then you can write an XSLT 2.0 transform which outputs to as many targets as you like. Note however that outputting to the same document you're inputting from can't be done. (That's just a basic principle of computers, not specific to XSLT.) You could of course output the modified original document to a new document, and wrap the whole thing in a script or program which deleted the original and renamed the new.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Editing XML with XSL ?
 
Similar Threads
JSP for transforming XML using XSL
HTML to XML
JSP + XSL + XML
Sample XML/XSL and corresponding HTML
help - Question on XSD and XSL