Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSLT custom function argument handling is broken #640

Closed
flavorjones opened this issue Mar 26, 2012 · 4 comments
Closed

XSLT custom function argument handling is broken #640

flavorjones opened this issue Mar 26, 2012 · 4 comments

Comments

@flavorjones
Copy link
Member

From nokogiri-talk, @marnen says:

1. Parameters are passed to external functions in incorrect order

# XSLT call
my_namespace:pad_number('12345', '9')

# Ruby
class Xslt::Functions
  def pad_number(value, length)
    ...
  end
end

result: value is "9" and length is "12345" -- the reverse of the calling order

2. External functions don't appear to support numeric arguments
# XSLT call
my_namespace:pad_number('12345', 9) <!-- note that second argument is now numeric -->

result:
/Users/marnen/.rvm/gems/ruby-1.9.2-p318/gems/nokogiri-1.5.2/lib/nokogiri/xslt/stylesheet.rb:21:in `transform': do not handle type: 3 (RuntimeError)
    from /Users/marnen/.rvm/gems/ruby-1.9.2-p318/gems/nokogiri-1.5.2/lib/nokogiri/xslt/stylesheet.rb:21:in `apply_to'
        [further traceback snipped -- this is the important part]

I've reproduced this. Working on it.

flavorjones added a commit that referenced this issue Mar 26, 2012
@flavorjones
Copy link
Member Author

I'll try to package up 1.5.3.rc3 tonight for you to test this. Thanks for using Nokogiri!

@flavorjones
Copy link
Member Author

1.5.3.rc3 is out. Good luck!

@marnen
Copy link

marnen commented Mar 27, 2012

Thanks! Will test soon and let you know if I have any further issues.

@marnen
Copy link

marnen commented Apr 18, 2012

It appears to work in 1.5.3.rc3. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants