使用XSLT处理对象图而不是XML文件 [英] Process an object graph as opposed to an XML file- using XSLT
问题描述
我试图找出是否可以将对象图提供给XSLT转换器而不是XML文件/流。我当然可以对序列化对象图并使用生成的XML进行序列化,但这似乎很浪费。
I'm trying to find out if I can feed an object graph into an XSLT transformer rather than an XML file/stream. I could of course XML serialize the object graph and use the resulting XML but this seems wasteful.
有没有人知道.Net中的这种机制?
Does anyone know of such a mechanism in or for .Net?
谢谢
Korp。
推荐答案
Hi Korp,
Hi Korp,
您打算将哪些API用于XSLT转换?
What API are you planning to use for the XSLT transformation?
如果您使用.Net framework System.Xml.Xsl.XslCompiledTransform.Transform()方法,它有一长串重载:文件,流,字符串,XML数据类型。因此,您可以尝试XML数据类型,而无需先将它们序列化到文件系统:
If you are using .Net framework System.Xml.Xsl.XslCompiledTransform.Transform() method, it has a long list of overloads: files, streams, strings, XML data types. So you can try XML data types without serializing them first to the file system:
这篇关于使用XSLT处理对象图而不是XML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!