 		case .rangeValue(let val):
 			result = CNTextLine(string: val.description)
 		case .pointValue(let val):
-			result = CNTextLine(string: "(x:\(val.x), y:\(val.y))")
+			result = CNTextLine(string: "{x:\(val.x), y:\(val.y)}")
 		case .sizeValue(let val):
-			result = CNTextLine(string: "(w:\(val.width), h:\(val.height))")
+			result = CNTextLine(string: "{width:\(val.width), height:\(val.height)}")
 		case .rectValue(let val):
-			let ptstr = "(x:\(val.origin.x), y:\(val.origin.y))"
-			let szstr = "(w:\(val.size.width), h:\(val.size.height))"
-			result = CNTextLine(string: "(" + ptstr + ", " + szstr + ")")
+			let ptstr = "origin:{x:\(val.origin.x), y:\(val.origin.y)}"
+			let szstr = "size:{width:\(val.size.width), height:\(val.size.height)}"
+			result = CNTextLine(string: "{" + ptstr + ", " + szstr + "}")
 		case .dictionaryValue(let val):
 			let sect = CNTextSection()
 			sect.header = "{" ; sect.footer = "}"

	case arrayValue(_ val: Array<CNNativeValue>)
	case objectValue(_ val: NSObject)

	public func numberElement(identifier ident: String) -> NSNumber? {
		if let elm = valueElement(identifier: ident){
			switch elm {
			case .numberValue(let obj):
				return obj
			default:
				break // do not return anything
			}
		}
		return nil
	}

	public func stringElement(identifier ident: String) -> String? {
		if let elm = valueElement(identifier: ident){
			switch elm {
			case .stringValue(let obj):
				return obj
			default:
				break // do not return anything
			}
		}
		return nil
	}

	public func pointElement(identifier ident: String) -> CGPoint? {
		if let elm = valueElement(identifier: ident){
			switch elm {
			case .pointValue(let obj):
				return obj
			default:
				break // do not return anything
			}
		}
		return nil
	}

	public func dictionaryElement(identifier ident: String) -> Dictionary<String, CNNativeValue>? {
		if let elm = valueElement(identifier: ident){
			switch elm {
			case .dictionaryValue(let obj):
				return obj
			default:
				break // do not return anything
			}
		}
		return nil
	}

	private func valueElement(identifier ident: String) -> CNNativeValue? {
		let result: CNNativeValue?
		switch self {
		case .dictionaryValue(let dict):
			result = dict[ident]
		default:
			result = nil
		}

		} else if let val = obj as? CGRect {
			result = .rectValue(val)
		} else if let val = obj as? Dictionary<String, Any> {
			var newdict: Dictionary<String, CNNativeValue> = [:]
			for (key, elm) in val {
				if let child = anyToValue(object: elm) {
					newdict[key] = child
				}
			}
			result = dictionaryToValue(dictionary: newdict)
		} else if let val = obj as? Array<Any> {
			var newarr: Array<CNNativeValue> = []
			for elm in val {
				if let child = anyToValue(object: elm) {
					newarr.append(child)
				}
			}
			result = .arrayValue(newarr)
		} else if let val = obj as? NSObject {
			result = .objectValue(val)
		} else {
			NSLog("[Error] Failed to convert \(obj) at \(#function)")
			result = nil
		}
		return result
	}

	public static func dictionaryToValue(dictionary dict: Dictionary<String, CNNativeValue>) -> CNNativeValue {
		if dict.count == 2 {
			/* Range type */
			if let locval = dict["location"], let lenval = dict["length"] {
				if let locnum = locval.toNumber(), let lennum = lenval.toNumber() {
					let location = locnum.intValue
					let length   = lennum.intValue
					return .rangeValue(NSRange(location: location, length: length))
				}
			}
			/* Decode point type */
			if let xval = dict["x"], let yval = dict["y"] {
				if let xnum = xval.toNumber(), let ynum = yval.toNumber() {
					let x = CGFloat(xnum.doubleValue)
					let y = CGFloat(ynum.doubleValue)
					return .pointValue(CGPoint(x: x, y:y))
				}
			}
			/* Decode size type */
			if let wval = dict["width"], let hval = dict["height"] {
				if let wnum = wval.toNumber(), let hnum = hval.toNumber() {
					let width  = CGFloat(wnum.doubleValue)
					let height = CGFloat(hnum.doubleValue)
					return .sizeValue(CGSize(width: width, height: height))
				}
			}
			/* Decode rect type */
			if let oval = dict["origin"], let sval = dict["size"] {
				if let origin = oval.toPoint(), let size = sval.toSize() {
					return .rectValue(CGRect(origin: origin, size: size))
				}
			}
		}
		return .dictionaryValue(dict)
	}
}
