Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Convert-Xml

Convert-Xml

pscx.dll

Synopsis

PSCX Cmdlet: Performs XSLT transforms on the specified XML file or XmlDocument.

Syntax

Convert-Xml [-Path] [-XsltPath] [-ConformanceLevel] [-EnableDtd] [-EnableScript] [<CommonParameters>]

Convert-Xml [-XsltPath] [-InputObject] [-ConformanceLevel] [-EnableDtd] [-EnableScript] [<CommonParameters>]

Convert-Xml [-LiteralPath] [-XsltPath] [-ConformanceLevel] [-EnableDtd] [-EnableScript] [<CommonParameters>]

Detailed Description

Performs XSLT transforms on the specified XML file or XmlDocument. Use the EnableScript parameter to enable script embedded in the XSLT file.

Parameters

-LiteralPath <String[]>

Specifies a path to the item. The value of -LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Path <String[]>

Specifies the path to the file to process. Wildcard syntax is allowed.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

true

-XsltPath <String>

Path to the XSLT file to apply during the transform.

Aliases

None

Required?

true

Position

2

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InputObject <PSObject>

Accepts an object as input to the cmdlet. Enter a variable that contains the objects or type a command or expression that gets the objects.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByValue)

Accept wildcard characters?

false

-ConformanceLevel <ConformanceLevel>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-EnableDtd <SwitchParameter>

Enables document type definition (DTD) processing.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-EnableScript <SwitchParameter>

Enable embedded script blocks in the XSLT.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- EXAMPLE 1 --------------------------

Transforms the XML in the input file foo.xml based on the XSLT specified foo.xslt.

C:\PS> Convert-Xml foo.xml foo.xslt

-------------------------- EXAMPLE 2 --------------------------

Transforms the XML in the input file foo.xml based on the XSLT specified foo.xslt while enabling embedded script to be processed.

C:\PS> Convert-Xml foo.xml bar.xslt -EnableScript

Format-Xml
Test-Xml