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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:35:12+00:00 2026-06-17T16:35:12+00:00

I want to read the value enquiry from the attribute name in the xml

  • 0

I want to read the value “enquiry” from the attribute “name” in the xml snippet provided below using xslt. Can anyone help me with it? I am totally new to xslt.

Thanks in advance. 🙂

<?table name="enquiry"?>
<thead>
<row rowsep="1">
<entry colname="col1">
  • 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-17T16:35:13+00:00Added an answer on June 17, 2026 at 4:35 pm

    A more general approach would be to define a template like this:

      <xsl:template name="GetPIAttribute">
        <xsl:param name="pi" />
        <xsl:param name="attrName" />
    
        <xsl:variable name="toFind" select="concat(' ', $attrName, '=')"/>
        <xsl:variable name="piAdjusted" select="concat(' ', normalize-space($pi))"/>
    
        <xsl:variable name="foundMatch" select="substring-after($piAdjusted, $toFind)" />
        <xsl:if test="$foundMatch">
          <xsl:variable name="delimiter" select="substring($foundMatch, 1, 1)" />
          <xsl:value-of select="substring-before(substring-after($foundMatch, $delimiter), $delimiter)"/>
        </xsl:if>
      </xsl:template>
    

    Then you could call it to retrieve any pseudo-attribute you wanted, like this:

      <xsl:template match="/">
        <xsl:call-template name="GetPIAttribute">
          <xsl:with-param name="pi" select="/processing-instruction()[name() = 'table']" />
          <xsl:with-param name="attrName" select="'name'" />
        </xsl:call-template>
      </xsl:template>
    

    The benefit with this approach is that it accounts for the value being enclosed in either single or double quotes, and that you can reuse it if you need to extract multiple values.

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

Sidebar

Related Questions

Added the following parameter in context.xml <Parameter name=channel value=any override=false/> I want to read
I want to read all cell value from excel sheet using Apache POI and
I want to know how to read the DropDown list value from the JSP.
I want these XML values read from the web service to a TextBlock ,
Hi I can't understand this error I want read this XML file: <?xml version=1.0
Using shell script I want to read a word from text file and return
I want to read the exit value from my console application to exit all
I want to read an appSettings value from the c:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportManager\Web.config
I want to read value from .ini file. Then write a condition - if
I want to read some simple parameters from a Google Drive Spreadsheet using Google

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.