web analytics

MSXSL.EXE: Microsoft Command Line XSL Transformation Utility

Options

davegate 143 - 921
@2016-01-21 15:26:53

The msxsl.exe command line utility enables you to perform command line Extensible Stylesheet Language (XSL) transformations using the Microsoft XSL processor, the Msxsl.exe utility invokes the Microsoft XML Parser 6.0 (msxml6.dll) to perform the transformation.

Because msxsl.exe is only a wrapper, Microsoft Core XML Services (MSXML) must be installed on the computer. You can download Microsoft Core XML Services (MSXML) 6.0 from the Microsoft Download Center.

Usage

The usage of MSXSL is as follows. Individual options may appear anywhere.

MSXSL source stylesheet [options] [param=value...] [xmlns:prefix=uri...]

Options:
    -?            Show this message
    -o filename   Write output to named file
    -m startMode  Start the transform in this mode
    -xw           Strip non-significant whitespace from source and stylesheet
    -xe           Do not resolve external definitions during parse phase
    -v            Validate documents during parse phase
    -t            Show load and transformation timings
    -pi           Get stylesheet URL from xml-stylesheet PI in source document
    -u version    Use a specific version of MSXML: '3.0', '4.0', '6.0'
    -             Dash used as source argument loads XML from stdin
    -             Dash used as stylesheet argument loads XSL from stdin

Parameters

Although 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 may be specified, as long as white space separates a parameter value from the next parameter name. Parameter names must conform to the 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.
  

@2017-09-21 23:23:09

The Microsoft Core XML Services (MSXML) 6.0 release provides standards-conformant implementations of:

  • XML 1.0 (DOM & SAX2 APIs)
  • XML Schema (XSD) 1.0
  • XPath 1.0
  • XSLT 1.0

MSXML6 is intended as an upgrade path for MSXML3 and MSXML4 users. MSXML6 is also the first version of MSXML to provide a 64-bit redistributable package.

@2017-09-29 21:39:37

You can find which versions of the MSXML parser have been installed on your machine in the following registry GUID:

HKEY_CLASSES_ROOT\CLSID\ {2933BF90-7B36-11D2-B20E-00C04F983E60}\VersionList.

Locate the Msxml6.dll file in the following directory:
C:\Windows\System32

Right-click the Msxml6.dll file, and then click Properties.

Click the Version/Detail tab to see the version information.

@2017-09-29 22:09:18

The easiest way to transform XML with MSXML is to use Internet Explorer to activate the transformation. When you include an xml-stylesheet processing instruction in the XML document and then open that XML document, Internet Explorer reads the xml-stylesheet processing instruction and automatically retrieves the stylesheet you've pointed to. Internet Explorer use MSXML to process the stylesheet and shows you the result in an HTML page.

In the following example, you ceate helloword.xml and helloworld.xsl in the c:\workspace\temp folder, and type c:\workspace\temp\helloworld.xml in the address box in the Internet Explorer:

helloworld.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" hre="helloworld.xsl"?>
<greeting>Hello World!</greeting>

helloworld.xsl

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
      xmlns:xsl= "http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>
</xsl:stylesheet>

 

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com