XslCompiledTransform导致悲痛使用InfoPath [英] XslCompiledTransform causes grief with Infopath

查看:155
本文介绍了XslCompiledTransform导致悲痛使用InfoPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是一个InfoPath开发人员,这是我使用XSLT第一次真正相遇。最近我不得不做一个项目,我需要上传到SharePoint成HTML InfoPath表单转换。一旦在HTML中,我们可以使用任何第三方库吐出任何我们想要的理想的/支持的格式。

I am not an infopath developer and this is my first real encounter with XSLT. Lately i've had to work on a project where i need to convert an infopath form uploaded to Sharepoint into html. Once in html we can use any thirdparty library to spit out any desired/supported format we want.

我们做什么在code:

What We Do In Code:

  1. 我们创建一个XslCompiledTransform对象。这是通过解析上载到共享点的XSN,然后使用XSL在那里进行。我们使用view1.xsl无效。没有问题,在这里发生。
  2. XML格式被返回作为流到我们的转换方法,其中,我们创建一个如下的变换需要被应用于使用流。
  3. 我们再传递的XmlDocument的变换()方法,以及一个XmlTextWriter的对象,它填充一个StringWriter的对象对我们来说。然后我们可以使用的StringWriter给我们的HTML作为一个字符串或流,并把它传递给第三方库更改为如PDF任何格式/ MHT等...

发生转换后的问题:

  1. 在我失去DateFormatting。一个日期最初设置为1-12-2009将成为2009-1-12
  2. 在我失去的图像,而不是图像,我们在他们获得与X空图像占位符。
  3. 在我失去主详细的部分。
  4. 在所有的HTML控件都through.I目前htmlstream转换为字符串,并且具有过滤掉任何不需要的HTML泛型方法。还有我的code,过滤掉选定值dropdownlists一部分。否则,我遇到了这样一个场景:有一个在HTML中没有选择属性,但这个值是在THR DropDownList的选择。这整个字符串解析不GRACEFULL,ITS黑客攻击。有没有更好的方式来做到这一点?
  5. 我如何可以检测的意见,如果有在XSN文件的多个视图。
  6. 有没有转换过的地方的XML文档就足够了,像财产以后XmlForm.CurrentView.Export()方法的一个简单的方法来处理我的特定情况。

任何建议,指针等将是非常美联社preciated。我很高兴地发送原始XML和转换HTML和HTML离开后,我的方法清除它。

Any suggestions, pointer etc would be much appreciated. I am happy to send in the original Xml and the converted Html and the Html left after my method cleans it up.

在此先感谢。

穆罕默德。

推荐答案

这是一个有趣的想法。但是,我不认为你永远不会得到它的工作,让您满意。通过XSL生成的XHTML变换你是拉从XSN被设计成只在InfoPath中显示。有相当多的InfoPath中特定功能内置到XHTML。您可能会得到一些有用的一半,但你会碰到很多的损坏或奇怪的显示问题。

This is an interesting idea. But I don't think you will ever get it to work to your satisfaction. The XHTML generated by the xsl transform you are pulling from the xsn is designed to display only in InfoPath. There is quite a lot of InfoPath specific functionality built into the XHTML. You may get something half useful, but you will run into a lot of broken or weird display issues.

例如,主从功能与XD实现:linkedToMaster属性。对XD命名空间的URI是 http://schemas.microsoft.com/office/infopath/2003
  这个命名空间的所有引用(也有很多他们)实施,将不会以任何其他XHTML渲染器来实现的InfoPath特定的功能。

For instance, the master-detail functionality is implemented with the xd:linkedToMaster attribute. The xd namespace's URI is http://schemas.microsoft.com/office/infopath/2003.
All references to this namespace (and there are a lot of them) implement InfoPath specific functionality that will not be implemented in any other XHTML renderer.

你拿这个实施工作将全部落实XD命名空间使用在自定义XHTML渲染功能的唯一途径。祝你好运。
对不起,我没有更好的消息。

The only way for you to get this implementation to work would be to implement all the functionality the xd namespace uses in a custom XHTML renderer. Good luck with that.
Sorry I don't have better news.

这篇关于XslCompiledTransform导致悲痛使用InfoPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆