diff --git a/test/test_xacro.py b/test/test_xacro.py
index 6ee89f8..699934f 100644
--- a/test/test_xacro.py
+++ b/test/test_xacro.py
@@ -1110,6 +1110,34 @@ def test_arg_function(self):
${xacro.arg('foo')}'''), 'bar')
+ def test_dynamic_arg_default(self):
+ self.assert_matches(self.quick_xacro('''
+
+
+
+
+
+
+
+'''), '''
+
+
+''')
+
+ def test_dynamic_arg_specified(self):
+ self.assert_matches(self.quick_xacro('''
+
+
+
+
+
+
+
+''', cli=['a_test:=test1', 'b_test:=test2']), '''
+
+
+''')
+
def test_broken_include_error_reporting(self):
self.assertRaises(xml.parsers.expat.ExpatError, self.quick_xacro,
'''
diff --git a/xacro/__init__.py b/xacro/__init__.py
index ef224df..f924928 100644
--- a/xacro/__init__.py
+++ b/xacro/__init__.py
@@ -952,6 +952,7 @@ def eval_all(node, macros, symbols):
elif node.tagName == 'xacro:arg':
name, default = check_attrs(node, ['name', 'default'], [])
+ name = str(eval_text(name, symbols))
if name not in substitution_args_context['arg']:
substitution_args_context['arg'][name] = str(eval_text(default, symbols))