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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:02:12+00:00 2026-05-20T18:02:12+00:00

I have an XML configuration file, i want to pull one of the fields

  • 0

I have an XML configuration file, i want to pull one of the fields from that file and include it on my XSL.

Here are the examples that I have come across:

<xsl:template match="">
  <html>
    <head>
      <title>My Page</title>
      <!-- CSS styles included here -->
      <xsl:copy-of select="document('style.xml')/style" />
    </head>
    <body>
      <!-- ... -->
    </body>
  </html>
</xsl:template>

But this doesn’t solve my problem as it includes the whole .xml file. I only want one of the properties in the xml file to be included so i would have to parse it inside the xsl and include only that node. How do i do that?

Thank you

Update from comments

If I include the following line in my
XSL:

<xsl:copy-of select="document('cmsaENV.xml')/STR_ENV_PROPS/text()"/>

And my xml contains:

<STR_ENV_PROPS value="c:/apps/cit/deploy/d_cmsadm/cmsa_applicationEnv.xml"/>

Then the string
"c:/apps/cit/deploy/d_cmsadm/cmsa_applicationEnv.xm"
will be placed inside my xsl? Is this
correct?

  • 1 1 Answer
  • 3 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-20T18:02:13+00:00Added an answer on May 20, 2026 at 6:02 pm

    I’m not sure to really get what you want, but if you want to include only the contents of the <style> element (and not the element itself), replace

    <xsl:copy-of select="document('style.xml')/style" />
    

    with

    <xsl:value-of select="document('style.xml')/style/text()" />
    

    text() selects the textual content of the style element in the imported document.

    EDIT: if instead of the textual contents you want the value of an attribute, you need something like:

    <xsl:value-of select="string(document('style.xml')/style/@someAttribute)" />
    

    Note that you need to convert the attribute into a regular text string, which I do with the string() function.

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

Sidebar

Related Questions

I have a configuration file in xml, with increasing specificity. That is, the closest
Question We have a large number of xml configuration files that we want merged
I know that there is a configuration file called web.xml What I want to
Like ini file, I basically want to have an easy-to-edit configuration file that can
I have an XML configuration file that contains a list of documents with field
I'm using apache commons library and log4j. I have an xml configuration file and
I have some values in a configuration file (XML file) with some values like
I have a file named configuration.xml which resides in classes folder of my WEB-INF
I have the following configuration file for NHibernate : <?xml version=1.0 encoding=utf-8 ?> <hibernate-configuration
Here's the scenario: I have a standard applicationConfig.xml spring configuration for a basic web

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.