Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6976907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:33:26+00:00 2026-05-27T17:33:26+00:00

Background A table ( equipment_group [eg]) includes various equipment categories: bakeware cookware kitchenware utensils

  • 0

Background

A table (equipment_group [eg]) includes various equipment categories:

bakeware
cookware
kitchenware
utensils

Problem

The values must be encoded XML elements, such as:

xmlelement( name eg.label )

Each element can have multiple objects, as shown in the following XML snippet:

<equipment>
  <bakeware>
    <object min-quantity="20">ramekin</object>
    <object alias="pan">shallow baking pan</object>
  </bakeware>
  <cookware>
    <object alias="pot">medium pot</object>
  </cookware>
  <utensils>
    <object alias="torch">kitchen butane torch</object>
    <object alias="sieve">fine-mesh sieve</object>
    <object alias="whisk">wire whisk</object>
  </utensils>
</equipment>

Update

At first glance, it appears as though xmlconcat can be used, however xmlconcat only allows balanced XML. That is, it does not seem possible to do the following:

xmlconcat( '<a>', '<b />', '</a>' )

This is well-formed XML, however xmlconcat raises an error:

ERROR:  invalid XML content
LINE 1: select xmlconcat( '<a>', '<b/>', '</a>' );
                          ^
DETAIL:  Entity: line 1: parser error : Premature end of data in tag a line 1

Question

How would you create XML elements with names that are populated using tabular data?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:33:26+00:00Added an answer on May 27, 2026 at 5:33 pm

    Since xmlconcat only accepts well-formed XML for parameters, one option is to create a sub-query of the desired elements as follows:

      xmlelement( name "bakeware",
        xmlconcat(
          array_to_string( array_agg(
            xmlelement( name "object",
              xmlattributes( e.abridge AS "alias" ),
              e.name
            )
          ), '')::xml
        )
      )
    

    This then concatenates all the rows (i.e., every value of <object ...>) into a single row of well-formed XML code. The row can then be concatenated using the xmlconcat function.

    A downside to this solution is that each of the items will have to have a duplicate query with a hardcoded name. This is somewhat acceptable when there are only a few elements. Another downside is that if additional element types are added (e.g., tableware, glassware, or dinnerware) or renamed (e.g., utensils to cutlery), then source code will have to be modified.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have one image background of table with following syntax style=background-image(URL) the problem is
I have given a table background image using css background-image property. The cells are
I have a gradient image as a background for a table header(9x18pix). This image
Background I have a dimension table that has a single record for each day.
I have a table where i want to change cell background on mouse over
I've a table view with a custom image background of each cell. In normal
I want to change the background color of the table cell when radio button
I'm trying to fade in the background colour of a table row, and can't
I have created a table in my application, I want to select (change background
How can we integrate a picture as a background image for a table.. <table>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.