开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜