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 6752645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:04:08+00:00 2026-05-26T13:04:08+00:00

<table name=ASSETS_TABLE statement-type=INSERT> <column name=ASSET_ID>string(/assets/asset/value())</column> <column name=ASSET_VALUE> <option name=VALUE_GREATER_THEN_0>/assets/asset > 0</option> <option name=VALUE_LESS_THEN_0>/assets/asset <

  • 0
<table name="ASSETS_TABLE" statement-type="INSERT"> 
    <column name="ASSET_ID">string(/assets/asset/value())</column> 
    <column name="ASSET_VALUE"> 
    <option name="VALUE_GREATER_THEN_0">/assets/asset > 0</option> 
    <option name="VALUE_LESS_THEN_0">/assets/asset < 0</option> 
    <option name="OTHERWISE">1</option> 
    </column> 
    <column name="ASSET_DESCRIPTION">string(/assets/asset/text())</column> 
    </table>

From the above XML, i need to get the values of the attributes (i.e name). For column and option nodes, how would you go about using a loop to get the value of the attribute and using it as an element name or a variable name and the value of the column node as value of the new element or variable.

So I’d want something like

<ASSET_VALUE>
<VALUE_GREATER_THEN_0>/assets/asset > 0</VALUE_GREATER_THEN_0> 
<VALUE_LESS_THEN_0>/assets/asset < 0</VALUE_LESS_THEN_0> 
<OTHERWISE>1</OTHERWISE> 
</ASSET_VALUE> 
<ASSET_DESCRIPTION>string(/assets/asset/text())</ASSET_DESCRIPTION>

Any help on this is really appreciated.

Thanks guys

  • 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-26T13:04:09+00:00Added an answer on May 26, 2026 at 1:04 pm

    Here’s an example based on my answer here.

    You didn’t specify what you wanted done for table, so I guessed.

    Using your XML input (modified to be well formed):

    <table name="ASSETS_TABLE" statement-type="INSERT"> 
      <column name="ASSET_ID">string(/assets/asset/value())</column> 
      <column name="ASSET_VALUE"> 
        <option name="VALUE_GREATER_THEN_0">/assets/asset > 0</option> 
        <option name="VALUE_LESS_THEN_0">/assets/asset &lt; 0</option> 
          <option name="OTHERWISE">1</option> 
      </column> 
      <column name="ASSET_DESCRIPTION">string(/assets/asset/text())</column> 
    </table>
    

    With this XSLT 1.0 stylesheet:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output indent="yes"/>
      <xsl:strip-space elements="*"/>
    
      <xsl:template match="node()|@*">
        <xsl:copy>
          <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
      </xsl:template>
    
      <xsl:template match="table|column|option">
        <xsl:element name="{@name}">
          <!--
          Uncomment the following "xsl:copy-of" if you want to 
          retain any attributes other than "name":
          <xsl:copy-of select="@*[name() != 'name']"/>
          -->
          <xsl:apply-templates/>
        </xsl:element>
      </xsl:template>
    
    </xsl:stylesheet>
    

    Produces this output:

    <ASSETS_TABLE>
       <ASSET_ID>string(/assets/asset/value())</ASSET_ID>
       <ASSET_VALUE>
          <VALUE_GREATER_THEN_0>/assets/asset &gt; 0</VALUE_GREATER_THEN_0>
          <VALUE_LESS_THEN_0>/assets/asset &lt; 0</VALUE_LESS_THEN_0>
          <OTHERWISE>1</OTHERWISE>
       </ASSET_VALUE>
       <ASSET_DESCRIPTION>string(/assets/asset/text())</ASSET_DESCRIPTION>
    </ASSETS_TABLE>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why can't I pass the table name to a prepared PDO statement? $stmt =
How can I in change the table name using a query statement? I used
I have 2 tables: City table - columns CityID , Name , Period Assets
My config table: name | value --------+------ version | 1.5.6 title | test How
I have this assets table: asset_id | mediumint(8) asset_type_id | mediumint(8) asset_name | varchar(200)
@Entity @Table(name = BOOKTEST) @NamedQueries({@NamedQuery(name = Booktest.findAll, query = SELECT b FROM Booktest b),
based on the following table Name --------- A A A B B C C
I have a script that takes a table name and generates a control file
Consider the following code: @Entity @Table(name = a) public class A implements Serializable {
I am using MS ACCESS 2003 TABLE NAME –> tmp_cardevent PERSONID CARDEVENTDATE CARDEVENTTIME 5008

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.