如何在处理 xinclude 之前转换 XML 文件
我有许多 XML 文件,它们被组织到不同的目录中。我需要将它们组合起来并使用 XSLT 转换结果。到目前为止,我已经做到了这一点,除了一个问题:一些 XML 文件需要先进行转换,然后才能包含到结果中。 xinclude 似乎忽略了 xml-stylesheet 声明。
如何在包含 XML 文件之前对其进行转换?
问候,
[ simon.cpu ]
I have numerous XML files that are organized into different directories. I need to combine them and transform the result using XSLT. So far, I have already done this except for one problem: some XML files need to be transformed first before it can be included into the result. xinclude seems to ignore the xml-stylesheet declaration.
How can i transform XML files before they are xincluded?
Regards,
[ simon.cpu ]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
流程如何运行?使用
Makefile
或类似的东西?在这种情况下,请在包含之前添加对 xsltproc 的显式调用,然后 xinclude xsltproc 的输出。如果 xsltproc 可以读取处理指令(
xml-stylesheet
,请注意,我没有对此进行测试),您甚至不必明确指示要使用的样式表。How is the process run? With a
Makefile
or something like that? In that case, add explicit calls to xsltproc before the inclusion and then xinclude the output of xsltproc.If xsltproc can read the processing instruction (
xml-stylesheet
, note that I did not test that), you do not even have to indicate explicitely the stylesheet to use.将其分解为多个转换调用,首先准备 xml 文件,然后进行主要转换。
Break it up into multiple transform calls, first prepare the xml files, then do your main transformation.