开发者

Unraveling the dependency tree for a set of XML files using XIncludes

开发者 https://www.devze.com 2023-02-01 15:45 出处:网络
I have a set of XML files (DocBook, to be specific). These use XML inclusions, aka XInclude, to reference one another. Giv开发者_运维百科en one of these XML files, what is the best way to figure out t

I have a set of XML files (DocBook, to be specific). These use XML inclusions, aka XInclude, to reference one another. Giv开发者_运维百科en one of these XML files, what is the best way to figure out the list of files which reference it? I'm looking to build up the dependency tree for that file. Said another way, if I change a given XML file, how can I calculate the list of other XML files which will be effected?


In the SVN repository of the DocBook SourceForge project, there is an xmldepend.xsl stylesheet module. Perhaps it is what you are looking for:

http://docbook.svn.sourceforge.net/viewvc/docbook/trunk/contrib/xsl/xmldepend/xmldepend.xsl


Given the one way relationships defined by XInclude, there isn't any direct XML based way to do this. Honestly, I would probably do a file search using find or grep.

You could, given the top level DocBook file, use a variant on the stylesheet that @mzjn pointed you at to generate all the dependencies in the compound document and then extract those where a document depends on the file you are currently interested in.

0

精彩评论

暂无评论...
验证码 换一张
取 消