Get page name via XSLT?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shifflav
    New Member
    • Dec 2008
    • 10

    #1

    Get page name via XSLT?

    I there a way to get the current page's name using XSLT and store it in a variable?

    Something like:

    <xsl:variable name="myVariabl e" select="PageNam e"/>
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    generally speaking, XSL can get everything contained in the source XML. If page name means the file name, then no (this requires file system functions).

    regards

    Comment

    • jkmyoung
      Recognized Expert Top Contributor
      • Mar 2006
      • 2057

      #3
      XSLT was not designed to do this (eg, be Environment aware). Some possibilities, depending on how you are running this transformation:

      1. Have the containing code (which calls the XSLT) pass in a parameter of the filename to the XSLT processor.
      2. Have the XSLT reference a static lookup file. Before running the transformation, update the file with the lookup file filename.

      Comment

      • shifflav
        New Member
        • Dec 2008
        • 10

        #4
        In my case, I assume the 'containing code (which calls the XSLT)' would be the ASP code I use to call both the XML and XSLT (see code below). Is that correct? If so, any idea how to do that?


        Code:
        <asp:Xml runat="server" documentSource="xml/sample.xml" transformSource="xml/sample.xsl" id="sample"  />

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          Use the Xml::TransformA rgumentList property
          Xml.TransformAr gumentList Property (System.Web.UI. WebControls)

          Adding parameters to the Argument list:
          XSLT Parameters

          Comment

          Working...