ࡱ> mol7 'bjbjUU *B7|7|c#Bl\%\%\%8%%L|^&&(&&&')*D]]]]]]]$z` b&]I*''I*I*]c.&&]@c.c.c.I*^&&]c.I*]c.c.0-N\ &% pdʷ=Z\%-R)Tt\4^H|^T c-jc\c.Command Line Transformations Using msxsl.exe Until now, there has been no off-the-shelf way to perform command line Extensible Stylesheet Language (XSL) transformations using the Microsoft XSL processor. MSXSL is a command line utility of less than 16 kilobytes (KB) that invokes msxml3.dll to perform the transformation. Requirements Because MSXSL is only a wrapper, msxml3.dll must be installed on the computer. You can download msxml3.dll from  HYPERLINK "http://msdn.microsoft.com/xml" http://msdn.microsoft.com/xml). NoteMicrosoft Internet Explorer 5.0, Internet Explorer 5.5 and Microsoft Windows 2000 released msxml.dll. This version is not recent enough to be used with MSXSL. MSXSL has been tested on Microsoft Windows NT, Windows 2000, Windows 98, and Windows 95. Use The use of MSXSL is as follows. Individual options can appear anywhere. MSXSL source stylesheet [options] [param=value...] [xmlns:prefix=uri...] Options -?Show this message.-o filenameWrite output to named file.-m startModeStart the transformation in this mode.-xwStrip nonsignificant white space from the source and style sheet.-xeDo not resolve external definitions during parse phase.-vValidate documents during parse phase.-tShow load and transformation timings.-Dash used as source argument loads XML from stdin.-Dash used as style sheet argument loads XSL from stdin. To transform an input file called books.xml using a style sheet named format.xsl, execute the following command. MSXSL books.xml format.xsl o out.xml Arguments are separated by white space. Single or double quotes can be used if the arguments themselves must contain white space. MSXSL o out.xml c:\my documents\books.xml format.xsl my-param=Quote Parameters XSL Transformations (XSLT) enable applications to pass  HYPERLINK "http://www.w3.org/TR/xslt" \l "top-level-variables" parameters to style sheets. Parameters are used to modify the behavior of a style sheet without requiring any code changes to that style sheet. Although the Microsoft XML Parser 3.0 (MSXML) allows parameters of any XSLT type to be passed to the style sheet, MSXSL allows only strings. Parameters are specified using a list of name-value pairs following the source and style sheet arguments. MSXSL o out.xml books.xml format.xsl p1=Microsoft p2=XSL Transformations Any number of parameters can be specified, as long as white space separates a parameter value from the next parameter name. Parameter names must conform to the HYPERLINK "http://www.w3.org/TR/1999/REC-xml-names-19990114" \l "ns-qualnames"XML QName syntax, with an optional prefix separated from a local name by a colon character. MSXSL books.xml format.xsl my-ns:param=XPath 1.0 xmlns:my-ns=urn:my If a prefix is specified, it must be defined in a namespace declaration elsewhere on the command line. The prefix cannot be xmlns because this identifies a namespace declaration. Namespace Declarations Parameter names and the start mode name can contain a prefix part. This prefix is a convenience alias for a namespace Uniform Resource Identifier (URI) that fully qualifies the name. A namespace declaration associates the prefix with a corresponding URI using a syntax that loosely follows that of an  HYPERLINK "http://www.w3.org/TR/1999/REC-xml-names-19990114" \l "ns-decl" XML namespace declaration. (Quotes are optional and prefixes can contain almost any character.) The namespace declaration begins with xmlns:, is followed by the prefix being defined, and ends with the URI to which the prefix is bound. MSXSL books.xml format.xsl my-ns:p1=Microsoft _ xmlns:my-ns=http://my.com Namespace declarations need not appear before they are used; names are resolved after the entire command line has been parsed. If the same prefix is defined multiple times, the last definition takes precedence. The default namespace declaration xmlns can be used to associate a URI with all names that do not have a prefix part. MSXSL books.xml format.xsl p1=Microsoft xmlns=http://my.com In this example, parameter p1 will be qualified with the http://my.com URI even though no prefix is used. Thus, this command line is equivalent to the previous command line that explicitly uses the my-ns prefix. Start Mode (-m Option) XSLT execution proceeds within a  HYPERLINK "http://www.w3.org/TR/xslt" \l "modes" current mode that is identified by a unique qualified name (Qname). When applying template rules, only templates that are associated with this mode can be considered possible matches. By default, template rules are grouped within the empty mode. However, they can be explicitly grouped within another mode by specifying the mode attribute on the  HYPERLINK "http://www.w3.org/TR/xslt" \l "section-Defining-Template-Rules" xsl:template element. Although style sheet execution usually begins in the empty mode, this default can be changed by using the m option to specify another mode. Changing the start mode allows execution to jump directly to an alternate group of templates. MSXSL books.xml mode.xsl m my-ns:modeA xmlns:my-ns=http://my.com If, as in the example, the start mode QName contains both a prefix and a local name, the prefix must be defined in a namespace declaration elsewhere on the command line. External Resolution (-xe Option) By default, MSXSL instructs the parser to resolve external definitions such as document type definition (DTD) external subsets or external entity references when parsing the source and style sheet documents. The xe option can be specified to disable this behavior (resolveExternals set to False). This setting will not affect the resolution of external documents referenced by the XSLT  HYPERLINK "http://www.w3.org/TR/xslt" \l "include" include or  HYPERLINK "http://www.w3.org/TR/xslt" \l "import" import elements or the XSLT  HYPERLINK "http://www.w3.org/TR/xslt" \l "document" document() function. Document Validation (-v Option) By default, MSXSL turns off document validation. If either the source or style sheet document has a DTD or schema whose content should be checked, the -v option can be specified to turn on validation by setting validateOnParse to True on the Document Object Model (DOM). White Space Stripping (-xw Option) The xw option instructs MSXSL to strip nonsignificant white space from the input XML document during the load phase by setting preserveWhitespace to False on the DOM. Enabling this option can lower memory usage and improve transformation performance while, in most cases, creating equivalent output. Timings (-t Option) The relative speed of various transformations can be easily measured by using the t option. MSXSL will track the performance of the following transformation steps. Time to load, parse, and build the DOM for the input document. Time to load, parse, and build the DOM for the style sheet document. Time to compile the style sheet in preparation for the transformation. Time to execute the style sheet. Redirection If the o option is not specified on the command line, MSXSL will send the raw output bytes to stdout. This means that the following command will dump the result of the transformation directly to the console window. MSXSL books.xml format.xsl Be aware that if the  HYPERLINK "http://www.w3.org/TR/xslt" \l "output" xsl:output encoding attribute is set to an encoding that does not match the code page of the console window, strange output may result. Stdout can be redirected from the command line using the usual mechanisms. MSXSL books.xml format.xsl > out.xml MSXSL books.xml format.xsl | more A single dash character, '-', can be substituted for either the source or style sheet argument. This instructs MSXSL to load the source or style sheet document from stdin rather than from a URL. MSXSL books.xml format.xsl | MSXSL toUTF8.xsl In this example, a formatted books.xml is piped to an identity transformation that converts it to UTF 8 for console display. Linking transformations together like this avoids intermediate file generation. Errors and timing information are sent to stderr, which can be redirected in Windows NT. This does not work in Windows 95 and Windows 98. MSXSL books.xml format.xsl > out.xml 2> err.txt Source Code The source code to msxsl.exe can be downloaded from the XML site. The sources were originally compiled using Microsoft Visual C++ 6.0. By default, the makefile will create a debug version of msxsl.exe, which includes debug information, unoptimized code, and asserts. To create a retail (release) build, invoke the makefile as follows. nmake clean cfg=retail The LIB and INCLUDE environment variables should be set to reference the lib and include directories of Visual C++, as follows. SET LIB=c:\program files\Microsoft visual studio\vc98\lib SET INCLUDE=c:\program files\Microsoft visual studio\vc98\include A small suite of tests can also be built by invoking nmake in the test subdirectory. To run the tests, execute test.exe. Some tests must be verified by inspecting the console window output. Filename:  FILENAME \* MERGEFORMAT Document1  PAGE 4   "&im1 3   T U V ` a +, ! lmOP0JGj UjVUjoUj~UjU0J0J0J#jU jUI-CP[$IfG$EƀJFIf, c''!"ICIC$IfG$EƀJFIfm$$IfP0l"ll064 PaP"&himCCm$$IfP0l"ll064 PaP$IfG$EƀJFIf0 CCG$EƀJFIfm$$IfP0l"ll064 PaP$If0 1 3 k IC$IfG$EƀJFIfm$$IfP0l"ll064 PaPk l m  * xu'p$$IfP0l"ll064 PaP'E3SbkC0EƀJF'(&5k l m'n''''''''''''Ǽ0J>mHnHu0J> j0J>U mHnHujU0JGjdUjU0J# jUjU*6Wc; y642C0EƀJFC0EƀJFC0EƀJF; V *!u!!!""|#$6$B$%%)&c&&c'''''''''+h]h8(&P/ =!|"|#$%DyK yK <http://msdn.microsoft.com/xmlDyK  yK 4http://www.w3.org/TR/xslttop-level-variablesDyK  yK bhttp://www.w3.org/TR/1999/REC-xml-names-19990114 ns-qualnamesDyK  yK bhttp://www.w3.org/TR/1999/REC-xml-names-19990114ns-declDyK  yK 4http://www.w3.org/TR/xsltmodesDyK  yK 4http://www.w3.org/TR/xslt section-Defining-Template-RulesDyK  yK 4http://www.w3.org/TR/xsltincludeDyK  yK 4http://www.w3.org/TR/xsltimportDyK  yK 4http://www.w3.org/TR/xslt documentDyK  yK 4http://www.w3.org/TR/xsltoutput[ iz`z Normal,APPLY ANOTHER STYLEd<<$5B*OJQJ_HmH phsH tH ` "Heading 1,h1,Level 1 Topic Heading$dp<@&^,5B*CJ$KHOJQJ_HmH phsH tH f`f "Heading 2,h2,Level 2 Topic Heading@& B*phf`f "Heading 3,h3,Level 3 Topic Heading@& B*ph``` "Heading 4,h4,Level 4 Topic Heading@&5h`h "Heading 5,h5,Level 5 Topic Heading@& 5B*phh`h "Heading 6,h6,Level 6 Topic Heading@& 5B*ph``` Heading 7,h7,First Subheading d@&CJ aJf`f Heading 8,h8,Second Subheading d@& CJ]aJd `d Heading 9,h9,Third Subheading d@& CJ^JaJ<A`< Default Paragraph FontPoP Text,td<<!B*OJQJ_HmH phsH tH 6o6 Figure,figdxxRoRCode,c d<(B* OJQJ_HmHnHphsH tH u<o12< Label in List 2,l25>o2> Text in List 2,t2 ^&o& Label,l5`R 8Footnote Text,ft,Used by Word for text of Help footnotes B*phrobr Numbered List 2,nl2 & F?d<<!B*OJQJ_HmH phsH tH orSyntax,sgd($d%d&d'd-D M NOPQ]d^( B*phHoH Table Footnote,tfd$(PCJ&` <Footnote Reference,fr,Used by Word for Help footnote symbols B*H*phPoPCode Embedded,ce B* CJOJQJmHnHphuBoB Label Embedded,le5CJOJQJ4o4 Link Text,lt >*B*phBoB Link Text Popup,ltp >*B*ph,o, Link ID,lid<B*PoP Table Spacing,tsd B*CJ ph>o>Code in List 2,c2 ^VoV Conditional Marker,cm<B*CJOJQJehfHFo2F Figure in List 2,fig2 "^.U@1. Hyperlink >*B*ph^o12^ Table Footnote in List 2,tf2$d$(PCJ<oab< Label in List 1,l1%5>ob> Text in List 1,t1 &h^h>or>Code in List 1,c1 'h^hFobF Figure in List 1,fig1 (h^h^oab^ Table Footnote in List 1,tf1)d$(PCJ8o8 HTMLB*CJOJQJehfHph6 `6 Footer,f+&dP6o6 Alert Text,at ,h^hLoaL Alert Text in List 1,at1 -^Lo1L Alert Text in List 2,at2 .8^8NoN Revision History,rh /] <B* phror Bulleted List 1,bl10 & F8d<<!B*OJQJ_HmH phsH tH DoD Text Indented,ti1hh]h^hro"r Bulleted List 2,bl22 & F=d<<!B*OJQJ_HmH phsH tH 6oB6 Defined Term,dt38o28 Definition,d4h^hroRr Numbered List 1,nl15 & F:d<<!B*OJQJ_HmH phsH tH 8o8 Glue Link Text,glt6HorH Index Tag,it7]5<B* phz`z Header,h18 "d$&dP]^%B*CJOJQJ_HmH phsH tH LoARL Label for Procedures,lp9 B* phBoB Copyright,copy:@d$]@CJT!`T Index Heading,ih;d@&^ B*CJphP `P Index 1,idx1<Ld$^`L B*CJphjoj Print Division Title,pdt=$dH^a$ B*CJ(phB)`B Page Number,pnB*CJOJQJphvovPrint MS Corp,pms?$d<a$,B*CJOJQJ_HmHnHphsH tH uvov Slugline,slug@dL 9&P#$+D./,B*CJOJQJ_HmHnHphsH tH uL`L TOC 1,toc1A h" <@& ^ B*phB`"B TOC 2,toc2B " h^h B*ph0`!20 TOC 3,toc3 C^0`!B0 TOC 4,toc4 D8^84 `R4 Index 2,idx2 E^4 `b4 Index 3,idx3 F^ oq Bold,b5`o` Multilanguage Marker Auto,mmaB*CJOJQJph2o2 Bold Italic,bi56xox (Multilanguage Marker Explicit Begin,mmebJd$ B*CJphdod &Multilanguage Marker Explicit End,mmeeK>* fofCode Featured Element,cfe#5B* CJOJQJmHnHphu'` 8Comment Reference,cr,Used by Word to flag author queriesaJ` 7Comment Text,ct,Used by Word for text of author queriesN$o$ Italic,i6fof Print Division Number,pdnPd]5;@xCJ>o> Strikethrough,strike7S*.o!. Subscript,subH*2o12 Superscript,supH*oB !Figure Image Map Placeholder,fimpVTP<<$d%d&d'dNOPQ^PoR Samples Button Marker,sbmVUP$d%d&d'dNOPQ^PLoaL SV7B*CJOJQJehfH phq rT-rT Macro TextW$da$5@B*CJOJQJph*B* Body TextXxp0p List Bullet,Y$ & FH hhd]ha$5@B*CJOJQJph,/, ListZh^h`#B -CP[!"&him013klm* x u 'E3Sbk6Wc;V*u| 6 B !!)"c""c#####00h00C,0C0Ch0000000000000000000000000000000000000h000000h00u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 0u 8 00u 8 00u 8 00u 8 00u h00W0W0W0W0W0W0W0W0W0W0Wh006 06 06 06 06 0@80@0@+0 0=?AAAD'"0 k '; ' ' U`  +  lO'k#XXXXXXXXXX %/18:D!8@0(  B S  ? _Hlt496443223 _Hlt496443224 _Hlt496593618 _Hlt496593619 _Hlt496593928 _Hlt496593925 _Hlt496593926 _Hlt496594097 _Hlt496594098 _Hlt496594146 _Hlt496594147 _Hlt496594355 _Hlt496594356 _Hlt496594442 _Hlt496594443 _Hlt496594542YY !#@@@@@@@@@ @ @ @ @ @@@ZZ ! ! "### r{#%,:jl).di ~ = B $)1=C;@NS',&5z|*0af ! !/!:!}!!!!!!""##b#c##### 9=c###33333## $)::b#c#### allyson adleycC:\Documents and Settings\allysa\Application Data\Microsoft\Word\AutoRecovery save of Document1.asd allyson adleyC:\my docs\msxsl.doc allyson adleyC:\my docs\msxsl.docPKREBS,C:\XML SDK 2.6\SOURCE\Web Articles\msxsl.docPKREBSJC:\XML SDK 2.6\3.0 Downloads\XSLT Command Line\XSLT Command Line\msxsl.doc7|}Zg~|2ZkLڤ2$8&%(] e Vg  XL V  >I vovAwp l z^N v[ K!)zR3% '4& p( VB- > &kP@ Fk@XM D>,p=ET00G" J _XJ ;Olaw0P 5R n?U|dVZU |U \uX aC_fqYl_ ]y` @J`4pb id Ij 8Lkv;N+fm Kjm p2tq756britU~ ^`.^`.88^8`.^`. ^`OJQJo( ^`OJQJo( 88^8`OJQJo( ^`OJQJo(hh^h`. hh^h`OJQJo(hh^h`.hh^h`.hh^h`.h hh^h`OJQJo(h 88^8`OJQJo(oh ^`OJQJo(h   ^ `OJQJo(h   ^ `OJQJo(oh xx^x`OJQJo(h HH^H`OJQJo(h ^`OJQJo(oh ^`OJQJo( hh^h`OJQJo(h ^`OJQJo(hpp^p`.h@ L@ ^@ `L.h^`.h^`.hL^`L.h^`.hPP^P`.h L ^ `L.8^`.hh^h`. hh^h`OJQJo(hh^h`o(. hh^h`OJQJo( hh^h`OJQJo(hh^h`. hh^h`OJQJo(hh^h`. hh^h`OJQJo( hh^h`OJQJo( hh^h`OJQJo(h ^`OJQJo(h ^`OJQJo(oh pp^p`OJQJo(h @ @ ^@ `OJQJo(h ^`OJQJo(oh ^`OJQJo(h ^`OJQJo(h ^`OJQJo(oh PP^P`OJQJo(hh^h`.h hh^h`OJQJo(h^`.h^`.hpLp^p`L.h@ @ ^@ `.h^`.hL^`L.h^`.h^`.hPLP^P`L. hh^h`OJQJo( hh^h`OJQJo(h hh^h`OJQJo(h^`.hpLp^p`L.h@ @ ^@ `.h^`.hL^`L.h^`.h^`.hPLP^P`L. hh^h`OJQJo(hh^h`.hh^h`. hh^h`OJQJo( hh^h`OJQJo(hh^h`. hh^h`OJQJo( hh^h`OJQJo( hh^h`OJQJo( hh^h`OJQJo( hh^h`OJQJo( hh^h`OJQJo(hh^h`.h^`. hh^h`OJQJo( hh^h`OJQJo(h ^`OJQJo(hhh^h`.hh^h`. hh^h`OJQJo(H>pbVZU]y`R3%'4&N+fmleVg l_KjmtU~V |U" J(][_XJkP@idw0Pp(5R6br DK!Ij@J`wp\uXVB-z^6br@| 6brL| 6brX| ~}|6brd| 6brp| 6br|| 6br| @J`@J`\uX\uXp=Ep=Etqtqn?Uovpov| 8Lktq| tq| 8Lk| G>I ;OXL Fk@aC_77         =<                 /<{        )>         -!"&him013klc###@))0 ))#@Unknown allyson adleyPKREBSGz Times New Roman5Symbol3& z Arial7&  Verdana?5 z Courier NewYMicrosoft Logo 95Symbol9Garamond;Wingdings"1ȈhhJFJF8f->$20d#q2QPC:\Documents and Settings\allysa\Application Data\Microsoft\Templates\MSDN20.dotMSDN Template for Authoring allyson adleyPKREBSOh+'0( 8D ` l x MSDN Template for AuthoringSDNallyson adleyfollyUse for authoring only. Do not use for publication. For publication in Microsoft Help, convert content to HTML and use an appropriate CSS. For publication as a printed book, attach msdn20pp.dot and complete the steps to print. For publication as a Word file, attach msdn20wf.dot. MSDN20.dothPKREBSd2REMicrosoft Word 9.0n@@[@=@=-՜.+,D՜.+,L hp  MSFTm># MSDN Template for Authoring Title 8@ _PID_HLINKSA<<-8http://www.w3.org/TR/xsltoutputGBhttp://www.w3.org/TR/xslt document(?http://www.w3.org/TR/xsltimport</http://www.w3.org/TR/xsltincludet$http://www.w3.org/TR/xslt section-Defining-Template-RulesJC http://www.w3.org/TR/xsltmodesj* 1http://www.w3.org/TR/1999/REC-xml-names-19990114ns-declM1http://www.w3.org/TR/1999/REC-xml-names-19990114 ns-qualnames8)http://www.w3.org/TR/xslttop-level-variableshttp://msdn.microsoft.com/xml  !#$%&'()+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcefghijknRoot Entry Fp8=pData "1Table*cWordDocument*BSummaryInformation(\DocumentSummaryInformation8dCompObjjObjectPoolp8=p8=  FMicrosoft Word Document MSWordDocWord.Document.89q