lib/openwfe/expressions/fe_fqv.rb in openwferu-0.9.16 vs lib/openwfe/expressions/fe_fqv.rb in openwferu-0.9.17
- old
+ new
@@ -1,8 +1,8 @@
#
#--
-# Copyright (c) 2007, John Mettraux, OpenWFE.org
+# Copyright (c) 2007-2008, John Mettraux, OpenWFE.org
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@@ -153,13 +153,37 @@
names :a, :attribute
def apply workitem
- text = fetch_text_content workitem
+ #text = fetch_text_content workitem
+ #text = text.strip
+ #result = if text[0, 3] == "---"
+ # YAML.load text
+ #else
+ # d = REXML::Document.new text
+ # XmlCodec::decode_attribute d.root
+ #end
+
+ child = @children.first
+
+ text = if child.is_a?(String)
+
+ child
+
+ elsif child.is_a?(FlowExpressionId)
+
+ exp = get_expression_pool.fetch_expression child
+ ExpressionTree.to_s exp.raw_representation
+
+ else
+
+ child.to_s
+ end
+
text = text.strip
- result = if text[0, 3] == "---"
+ result = if text[0, 3] == '---'
YAML.load text
else
d = REXML::Document.new text
XmlCodec::decode_attribute d.root
end