How do you create an XML/XSLT DEcompiler?

2019-09-05 23:13发布

问题:

I am working on a new project that has a system that builds an XML file and assorted XSLT files for the stylesheets. If I want to take the completed page in the browser and modify it - and then decompile it into its component parts - how would one do it?

回答1:

You mean you want to reverse the transformation? So if the XML contains the prices of all your products, and the HTML displays their sum, you want the user to be able to change the total, and you go back and recompute the prices of all the products? Think again about what you are asking for.



回答2:

Generally, obtaining the input from the output of a transformation is not possible.

This is exactly the same if you substitute in the above sentence the word "transformation" with the word "function.

A function has a reverse one only if it is a 1:1 mapping.

Any function that is not 1:1 doesn't have a reverse function.

So, if it is possible that a transformation produces the same output from more than one XML document, then just looking at the output it is not possible to determine which exactly of these XML documents was the input.



回答3:

You cannot. [spacer data here]