You can translate the question and the replies:


Hi, I have an XML field in my view and I have different problems to manipulate it in Denodo. First onne, I want to use the function xmlquery to get a specific list of element in my XML. for example, I have this xml : <?xml version='1.0' encoding='UTF-8'?> <shop> <products> <product> <id>1</id> <name>Virtual DataPort</name> </product> <product> <id>2</id> <name>ITPilot</name> </product> <product> <id>3</id> <name>Scheduler</name> </product> </products> </shop> I want to get all the products but each product must be in a specific line, I dont want to get the result of the 3 products in the same line in denodo View. Is this possible? I also want to use some function like CREATETYPEFROMXML, but it's said in the documentation : The function CREATETYPEFROMXML is deprecated and may be removed in future versions of the Denodo Platform. Instead, create an XML data source with a route of type from variable and pass the XML document to this data source ==> so how can I transform an XML field in my view into a register object or array and manipulated more easily, or maybe create some base views using this field? As I said, I dont have an XML file as data source but rather an XML field comming from a mongodb Database as text and then I transform it to xml. Thank you,
24-02-2023 03:25:26 -0500

1 Answer

Hi, The function CREATETYPEFROMXML is going to be deprecated as you well said, so the best approach in this case is to use the proposed alternative. I'd create a base view of your mongodb collection where you will store the xml field, and then create the XML data source with a route of type "From variable". Then, you can name this variable and create a base view from this data source using and xml example that matches the expected fields that you will have on your mongodb xml field. Then, with this base view created, you just need to join both views, making the relation with the xml field in the mongodb view and the variable from the xml view. I've realized that your xml field in mongodb is not ok (some tags are not closed). Make sure that the value is a valid xml. Hope this helps!
Denodo Team
27-02-2023 10:40:57 -0500
You must sign in to add an answer. If you do not have an account, you can register here