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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:45:48+00:00 2026-06-19T00:45:48+00:00

I have this xml returned from sql : <Keywords> <Record CIMtrek_Keywords=Bus Dev|Ser Del|Sol Del|?

  • 0

I have this xml returned from sql :

<Keywords>
  <Record CIMtrek_Keywords="Bus Dev|Ser Del|Sol Del|?" />
</Keywords>

and i want to put these values one by one in combo box, sample code is below which has got Increase and Decrease as value same way i would like to have Bus Dev and Ser Del and Sol Del and ? one by one

<select size="1" style="width:60%;" name="CIMtrek_CI_CER_Type"
                                                id="CIMtrek_CI_CER_Type">
                                                <option value="0">Select Fund Type</option>
                                                <option value="Increase">
                                                    <xsl:if test="//Record/CIMtrek_CI_CER_Type/text()='Increase'">
                                                        <xsl:attribute name="selected">true</xsl:attribute>
                                                    </xsl:if>
                                                    Increase
                                                </option>
                                                <option value="Decrease">
                                                    <xsl:if
                                                        test="//Record/CIMtrek_CI_CER_Type/text()='Decrease'">
                                                        <xsl:attribute name="selected">true</xsl:attribute>
                                                    </xsl:if>
                                                    Decrease
                                                </option>
                                            </select>

This is how i created combo box from the values which is in xml generated from SQL query :

<xsl:for-each select="//CIMtrek_CarrierName/Record">
                                                    <option>
                                                        <xsl:if
                                                            test="//Record/CIMtrek_RegWhseCo_Carrier/text()=@CIMtrek_CarrierName">
                                                            <xsl:attribute name="selected">true</xsl:attribute>
                                                        </xsl:if>
                                                        <xsl:attribute name="value"><xsl:value-of
                                                            select="@CIMtrek_CarrierName" />!@#$%^*!<xsl:value-of
                                                            select="@Carrier_LateContacts" />!@#$%^*!<xsl:value-of
                                                            select="@Carrier_Contacts1" />!@#$%^*!<xsl:value-of
                                                            select="@Carrier_Contacts2" />!@#$%^*!<xsl:value-of
                                                            select="@Carrier_Contacts3" /></xsl:attribute>
                                                        <xsl:value-of select="@CIMtrek_CarrierName" />
                                                    </option>
                                                </xsl:for-each>

with BeniBela answer i am not able to put things in, like the above code,

Hope BeniBela can help me to figure it out.

How to do this,

Please help me,

Best Regards.

  • 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-06-19T00:45:49+00:00Added an answer on June 19, 2026 at 12:45 am

    The tokenize() function does exactly this. Note that takes a regular expression, so | has to be escaped as [|] leading to:

    for $o in /Keywords/Record/tokenize(@CIMtrek_Keywords, "[|]") return
      <option value="{$o}">{$o}</option>
    

    That new xml can be converted to xquery like this:

    for $r in //CIMtrek_CarrierName/Record return  $r/
      <option value="{@CIMtrek_CarrierName}!@#$%^*!{@Carrier_LateContacts}!@#$%^*!{@Carrier_Contacts1}!@#$%^*!{@Carrier_Contacts2}!@#$%^*!{@Carrier_Contacts3}">
      {  if (//Record/CIMtrek_RegWhseCo_Carrier/text()=@CIMtrek_CarrierName) then attribute selected { "true" } else (),
         data(@CIMtrek_CarrierName)  }
      </option>
    

    The intitial $r/ changes the context, so we do not need to write $r/ before every attribute access, the xsl:value-of becomes {..} and xsl:attribute becomes an xml-like attribute declaration or ‘attribute name {..}’

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

Sidebar

Related Questions

I have this XML returned from partial view. <ActualizarItem> <NombreItem>GASEOSA 8.5 ONZAS</NombreItem> <OpcionesItem>&lt;div id=MenuItemEnPedidodata-role=navbar
I have this xml from which I am trying to grab the value in
I have dynamically created a xml string form a JSON object returned from server.
I'm using javascript to pull data returned from an XML document. Inside this XML
I have been provided an XSD file to unmarshall the XML returned from an
I have a stream of xml being returned from a webservice which is coming
I have fairly large set of data returned via AJAX from a page. This
Hello I have the following xml results that are returned from a remote site
I have this xml <products> <product> <name>Demo</name> </product> <product> <name>Black Beauty III</name> <description>Beautiful les
I have this xml file which has text init. i.e Hi my name is

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.