XSLT in Java, so confusing...

Discussion in 'OT Technology' started by babygodzilla, Oct 2, 2008.

  1. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    Trying to run some regex in XSLT1 using Java. I have these defined at the top:

    Code:
        xmlns:regex="java:java.util.regex.Pattern" 
        xmlns:string="java:java.lang.String" 
    tried to do this

    Code:
    <xsl:variable name="pattern" select="regex:compile('my regex here')"/>
    and i got a complained that the argument in compile() is not an object. great, so i try to create a String object using

    Code:
    <xsl:variable name="regex" select="string:new('my regex here')"/>
    cept now i get a complain
    what the hey is going on...
    and no i can't upgrade to XSLT2. i wish to jesus and mary i could...

    appreciate any help. thanks!
     
  2. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    I'm confused; why are you trying to run Java commands from inside an XML stylesheet?
     
  3. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    Wanna format an XML to a different format using this XSL. There's some regex matching I have to do, and there is no support for it in XSLT 1.0
     

Share This Page