Passing parameters to XSLT parsing...

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Passing parameters to XSLT parsing...

    Hi all

    I''m a bit stuck with this and worst of all I know it's part of CFMX 7 (which
    I am now using) but I can't get it to work :(

    My code is reading an XML document, an XSL document, creating a Java hashmap
    of params and passing everything into the XmlTransform function.

    In my XSL I have the following:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:variable name="vCountry">EN</xsl:variable>
    ....

    I expected this variable to take the value of the passed variable but no joy,
    it always remains as 'EN'.

    Any ideas: here is my CF code:

    <cfset xsltParams = createObject("java", "java.util.HashMap").init()>
    <cfset xsltParams.put("vCountry", ListGetAt(iLocale, 1, "_"))>

    <cfset sHTML = XmlTransform(Trim(sXML), Trim(sXSLT), xsltParams)>

    Any help or tips suggested would be great!
    Ciaran.




    TinkerToy__ Guest

  2. Similar Questions and Discussions

    1. Passing Parameters To CFC
      I am testing how to return data from a CFC within Flash Forms. I have a simple <cfselect> tag that will hold data returned from a CFC. This CFC...
    2. Parsing Search Parameters
      I'm splitting the following: "Custom Report" +Red -Green to get a list like "Custom Report" AND|Red NOT|Green
    3. Passing Parameters into NEW()
      Is there any way that the NEW() of a web service can accept parameters ? I would like to pass a boolean to indicate to the webservice that I am in...
    4. xslt for validating in parameters
      Hi, I would like to create a filter of some sort for applying an xsl to the incoming soap request before it reaches my webmethod. I found no easy...
    5. Parsing Parameters not working
      For some reason when I call one ASP program from another, I am not parsing out the parameters correctly. Caling ASP has <a...
  3. #2

    Default Re: Passing parameters to XSLT parsing...

    Try using <xsl:param ...> in your xsl rather than <xsl:variable>
    tkrussel Guest

  4. #3

    Default Re: Passing parameters to XSLT parsing...

    Sorry. The : p got parsed into a emoticon. I meant to say:


    <xsl:param name="vCountry">EN</xsl:param>
    tkrussel Guest

  5. #4

    Default Re: Passing parameters to XSLT parsing...

    Thanks very much that did the trick. What was I thinking with <xsl:variable> ?? :D
    TinkerToy__ Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139