如何用msxsl一次输出多个文件!解决者得300分,决不食言!

chechy 2002-01-25 11:26:46
加精
在saxon中可以使用saxon:output来解决。msxsl似乎只能用msxsl:script,但我不知道该怎么写这个script!先给100分,如果解决了,我再加分。
...全文
80 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wss_scaler 2010-06-03
  • 打赏
  • 举报
回复
像你们学习
wss_scaler 2010-06-03
  • 打赏
  • 举报
回复
二位真牛
chechy 2002-01-28
  • 打赏
  • 举报
回复
谢谢,给分。
karma 2002-01-25
  • 打赏
  • 举报
回复
that was just a demo which showed you could do something with the node list passed in, for your purpose, you can try something like this:

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="whatever"
>
<msxsl:script implements-prefix="user" language="jscript">
<![CDATA[
function testCode(nodes)
{
var fso=new ActiveXObject("Scripting.FileSystemObject");
var f = fso.createTextFile("d:\\temp\\testxml.xml",true);
//f.writeLine("<root>");//new a root element
for (var i= 0; i < nodes.length;i++)
f.writeLine(nodes[i].xml);
//f.writeLine("</root>");
f.close();
fso=null;
return "";
}
]]>
</msxsl:script>
<xsl:variable name="myvar">
<s>13214</s><t>abc</t>
</xsl:variable>
<xsl:template match="/">
<xsl:value-of select="user:testCode($myvar)"/>
</xsl:template>
</xsl:stylesheet>
chechy 2002-01-25
  • 打赏
  • 举报
回复
多谢,我试试。不知道你的代码是不是写Tree Fragment的代码。不过,没有关系,我过两天测试通过就给分。
karma 2002-01-25
  • 打赏
  • 举报
回复
在MSXML中没有这样的扩展功能,当然,你总归可以在msxsl:script中用"Scripting.FileSystemObject"输出另外的文件, 譬如

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="whatever"
>
<msxsl:script implements-prefix="user" language="jscript">
<![CDATA[
function testCode(nodeList)
{
var fso=new ActiveXObject("Scripting.FileSystemObject");
var f = fso.createTextFile("d:\\temp\\testxml.txt",true);
var nodes = nodeList.item(0).childNodes;
for (var i= 0; i < nodes.length;i++)
f.writeLine(nodes[i].xml);
f.close();
fso=null;
return "";
}
]]>
</msxsl:script>
<xsl:template match="/">
<xsl:value-of select="user:testCode(/)"/>
</xsl:template>
</xsl:stylesheet>
源码8 IDOMDocument vs. IXMLDocument.... . 8 TXMLDocument Programming .... 9 XML TreeView .. 12 TXMLDocument as Windows Service........................................... 14 XML Data Binding .............................................................................. 16 Generated Code ...................................................................... 20 Delphi XML Mapper............................................................................ 23 The XML Mapping Tool.............................................................. 23 Selecting Nodes ...................................................................... 24 Create and Test Transformation................................................. 26 XMLTransform......................................................................... 28 Visual Transformation .............................................................. 30 TXMLTransformClient ............................................................... 31 XSLT ............................................................................................... 32 XSL Transformations................................................................ 32 MSXSL ................................................................................... 32 Some examples of XSLT.................................................... 32 Default XSLT Templates ........................................................... 34 Our own XSLT Processor........................................................... 35 XML and XSL .......................................................................... 35 XMLData property ............................................................ 35 FileName property............................................................ 35 XML property................................................................... 36 XSLT Processor ....................................................................... 37 Alternative Approach ........................................................ 37 Summary......................................................................................... 38 2. Web Services: SOAP & WSDL 39 Web Services.................................................................................... 39 SOAP..................................................................................... 39 WSDL .................................................................................... 39 XSD Data Types ...................................................................... 41 SOAP and XML ........................................................................ 41 Building Delphi for Win32 Web Services................................................ 42 Debug and ISAPI..................................................................... 43 Second target (Indy) ........................................................ 44 SOAP Web Module............................................................ 45 SOAP Server Interface ............................................................. 47 SOAP Server Implementation .................................................... 51 Indy VCL Project ............................................................................... 53 Consuming Web Services.................................................................... 55 SOAP Client ............................................................................ 56 Using GetIEcho ....................................................................... 60 Delphi XML, SOAP & Web Services Bob Swart Training & Consultancy - iii - www.drbob42.com Using THTTPRIO...................................................................... 64 WSDL vs. SOAP....................................................................... 65 AdminEnabled......................................................................... 66 GetIEcho Implementation ......................................................... 69 Conversion Web Services.................................................................... 70 TemperatureIntf...................................................................... 72 TemperatureImpl .................................................................... 72 Debugging Web Services .................................................................... 73 Web Service Client................................................................... 73 Server Breakpoints .................................................................. 74 Deployment on Windows Server 2003 and IIS ....................................... 75 Enabling ISAPI / CGI................................................................ 75 Virtual Directory ...................................................................... 76 SSL Certificates................................................................................. 79 SSL and IIS6 on Windows Server 2003....................................... 79 Installing SSL Certificates ......................................................... 82 Deployment on Windows Server 2008 and IIS7 ........................... 83 Tracing Web Services......................................................................... 88 SOAP and Exceptions ......................................................................... 89 Echo Interface unit .................................................................. 89 Echo implementation unit ......................................................... 89 Echo import unit...................................................................... 90 Extending SOAP Exceptions....................................................... 90 SOAP and Databases ......................................................................... 92 Database Client....................................................................... 94 Extra Data Module ................................................................... 96 Alternative to data module: web module..................................... 98 SOAP Attachments ............................................................................ 98 Receiving SOAP Attachments .................................................... 101 Summary......................................................................................... 103 Exercises.......................................................................................... 103 Exercise #1 ............................................................................ 103 Exercise #2 ............................................................................ 103 Exercise #3 ............................................................................ 103 Exercise #4 ............................................................................ 103 Exercise #5 ............................................................................ 103 Exercise #6 ............................................................................ 103 Exercise #7 ............................................................................ 103 Exercise #8 ............................................................................ 103 3. SOAP and Security 105 SSL Certificates................................................................................. 105 Web Service Example......................................................................... 105 SourceCodeIntf................................................................ 105 SourceCodeImpl .............................................................. 106 Importing Win32 Secure Web Service ................................. 107 Summary......................................................................................... 108 Exercises.......................................................................................... 108 Exercise #1 ............................................................................ 108 Exercise #2 ............................................................................ 108 Exercise #3 ............................................................................ 108 4. Case Study: Automatic Updates 109

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧