动态 XSL 文件
我有 3 个 XSL 文件,其中包含 C:\templates\Test\file.pdf 之类的路径。
该路径并不总是相同,而不是将其硬编码在 XSL 中,我希望它以便路径 C:\templates\test\ 被标记 [BASEPATH] 替换,当我将 xsl 文件读入 XSLTransform 对象时(是的,我知道它已被弃用,我可能会同时移至 XSLCompiledTransform ),我希望将标签 [BASEPATH] 替换为 Web 文件夹的绝对文件路径(或 Server.MapPath("~") ,因为它在 .net 中)
我想我也许可以制作一个XSLLoader aspx 页面通过查询字符串获取 XSL 文件的名称,然后通过 xml 内容类型返回 XSL 文件。当我尝试这样做时,我收到了 503 错误,因此我不确定是否可以将这样的 url 传递到 XSLTransform.Load 方法中。
有什么想法要做什么吗?
I have 3 XSL files which have paths in them to something like C:\templates\Test\file.pdf
This path isn't always going to be the same and rather than having it hard coded in the XSL, I'd like it so that the path C:\templates\test\ is replaced with a tag [BASEPATH] and when I read in the xsl file into the XSLTransform object (yes I know it's been deprecated, I may move over to the XSLCompiledTransform at the same time), I'd like the tag [BASEPATH] to be replaced with the absolute file path of the web folder (or Server.MapPath("~") seeing as it is in .net)
I thought I may be able to make an XSLLoader aspx page which takes the name of the XSL file through the querystring and then returns the XSL file via xml content-type. When I try this, I get a 503 error though so I'm not sure if you can pass urls like this into the XSLTransform.Load method.
Any ideas what to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您看过 XSL 参数吗?
然后,大多数不错的 XSLT 引擎都有一种从外部设置根级别参数的方法。
Have you looked at XSL parameters?
Then, most decent XSLT engines have a way to set a root level parameter from outside.