mricaud / xml-utilities

A set of xml utilities, like xslt common tools etc.
Apache License 2.0
6 stars 2 forks source link

get-xml-file-static-dependency-tree: dealing with fn:transform #21

Open mricaud opened 4 years ago

mricaud commented 4 years ago

As Liam Quin said in https://xmlcom.slack.com/archives/C011NLXE4DU/p1601234961085300?thread_ts=1601201199.078900&cid=C011NLXE4DU, it would be a nice idea to deal with fn:transform ()

fn:transform takes a map as input. This map defines stylesheet-location which might be parsed to get a new dependency. If the language is XSLT (it could be schematron or xspec or any other languages using xpath) then we have to be carefull that the value is not dynamically computed.

cmarchand commented 4 years ago

Not an easy thing to do ! The map can be written inline in the XPath expression, but it can also be constructed via function calls, parameters, etc... So you have to evaluate the XPath expression, but also the whole XSL, and even its imported/included/used-package dependencies ! But you are able to do this ! Have a look at this : https://bottlecaps.de/rex/ It generates a parser in XSLT for the language you need. XPath and XSLT are supported.

mricaud commented 4 years ago

This has to do with issues #4, but I think it has no sens because the xpath could be related to the XML input file which is not a static dependency :) But as Liam suggested : just writing the xpath as dependency (not going further) would be an helpfull information, fair enough :)