SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Dec 1999
    Location
    Southampton, Hants, UK
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can I pass a variable to an XSLT

    Can I pass a variable to an XSLT, without having to dynamically create the transformer.

    You see I have a java class that takes the path to an xml document, path to the xslt, and returns the resultant string:

    String result = xmlTransformer.transform( "menu.xml","menu.xsl")

    But there are a few cases where I would love to have all the information in a single xml document, and a single xslt, so I could have something like:

    String result = xmlTransformer.transform( "menu.xml","menu.xsl?entries=5" )

    or something like that. the idea is that I can get away with having to have an excessive amount of xslt files.

  2. #2
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you need to look at PARAM ? This will allow you to pass in variables, via PHP to the XSL-T processor it's self.

    Although I also need to look at this some more myself, so cannot post any script

  3. #3
    SitePoint Guru
    Join Date
    Dec 1999
    Location
    Southampton, Hants, UK
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK no probs, I'm not actually using php, its all done in java. But I'll have a look into passing parameters into it.

    Thanks


Bookmarks

Posting Permissions

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