How do you create an XML/XSLT DEcompiler?

2019-09-05 23:06发布

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?

3条回答
啃猪蹄的小仙女
2楼-- · 2019-09-05 23:11

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.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-09-05 23:12

You cannot. [spacer data here]

查看更多
相关推荐>>
4楼-- · 2019-09-05 23:19

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.

查看更多
登录 后发表回答