Stringing Together XML
By Antony Reynolds-Oracle on Mar 07, 2008
Stringing Together XMLSomeone just asked how to convert a string into XML. A common use case is to retrieve XML stored as a string in the database. Although you could argue that it would be better to store XML using the XML facilities of the Oracle database the fact is we still see lots of XML stored as VarChar2 or CLobs. So how can we read these into BPEL? Well in addition to explaining this I thought it was also a good excuse to explain the use of the append rule within an assign and also a use for the anyType.
Reading XMLFortunately the developers foresaw the problem of converting strings to XML and have provided a handy function ora:parseEscapedXML which takes a string as a parameter and returns an XML document. The string can be either a full XML document or just a document fragment. Similarly it can have an explicit namespace or no namespace.
I have uploaded a simple BPEL process that takes an XML string as input and returns the DOM representation of that string.