2005-09-30

Reading an XML attribute via BIE's "Assign" action

You can use the "Assign" action in BIE to retrieve the contents of an element or attribute of an XML document (or "message" in BIE-speak). But if you try to retrieve the value of an element in a document like -


<root attribute="value"><parameter name="id">1</parameter></root>


- via the obvious XPath of "/root/@attribute" you will get a "BIE INTERNAL ERROR". The workaround is to do something like this: "concat(/root/@attribute, '')".

According to Mr. Fruetel it seems as though the "Assign" action gets confused with attributes and doesn't know whether to return text or an XMLNode; by doing the "concat" operation the result is forced to be text and everything works as expected.

Note: This situation and example is taken from a thread on the bie-developer list.

No comments:

Post a Comment