XSLTransforms Collection

Microsoft Word Visual Basic

XSLTransforms Collection

XMLNamespace XSLTransforms
XSLTransform

A collection of XSLTransform objects that represent all of the Extensible Stylesheet Language Transformations (XSLTs) for a specific XML namespace.

Using the XSLTransforms Collection

Use the Add method to add an individual XSLTransform object to the collection of XSLTs for a schema. The following example adds simplesample.xslt to the XSLTs for the SimpleSample schema.

      Sub AddXSLT()
    Dim objSchema As XMLNamespace
    Dim objTransform As XSLTransform
    
    Set objSchema = Application.XMLNamespaces("SimpleSample")
    Set objTransform = objSchema.XSLTransforms _
        .Add("c:\schemas\simplesample.xslt")

End Sub
    

Use the Item method to return a single XSLTransform object. The following example deletes the first XSLT in the collection of XSLTs for the SimpleSample schema.

    Sub DeleteTransform()
    Dim objXSLT As XSLTransform
    Dim intResponse As Integer
    
    Set objXSLT = Application.XMLNamespaces("SimpleSample") _
        .XSLTransforms.Item(1)
    
    intResponse = MsgBox("Are you sure you want to delete the " _
        & objXSLT.Alias & " XSL transform?", vbYesNo)
            
    If intResponse = vbYes Then objXSLT.Delete
    
End Sub
  

Note  The SimpleSample schema is included in the Smart Document Software Development Kit (SDK). For more information, refer to the Smart Document SDK on the Microsoft Developer Network (MSDN) Web site.