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

  • Home
  • SEARCH
  • 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 9181783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:24:09+00:00 2026-06-17T18:24:09+00:00

I am asking essentially the same question as found in this post: How to

  • 0

I am asking essentially the same question as found in this post: How to Get XML Node from XDocument with the exception of attempting to do a one-shot return of the CData value in a single line of code. I’m attempting to get the return in the below function to work properly:

private string RetrieveFormattedString(string controlId)
{
    return template.Descendants("Template")
      .Where(templateNode => templateNode.Value == controlId)
      .Where(tmp => tmp.Name == "Format").Select(y => y.Value).ToString();
}

I have the following XML below:

<?xml version="1.0" encoding="utf-8" ?>
  <Templates>
    <Template>
      <Name>NodeName1</Name>
        <Parameter Type="TextBox" Name="conferenceID">{__otcConferenceID__}</Parameter>
        <Parameter Type="TextBox" Name="conferenceCode">{__otcConferenceCode__}</Parameter>
        <Format>
          <![CDATA[ <b>NodeName1</b><br /> <table><tr><td>iPhone</td><td>{__otcConferenceID__},#,{__otcConferenceCode__}</td></tr></table>]]>
        </Format>
     </Template>
     <Template>
        <Name>NodeName2</Name>
        <Parameter Type="TextBox" Name="conferenceID">{__otcConferenceID__}</Parameter>
        <Parameter Type="TextBox" Name="conferenceCode">{__otcConferenceCode__}</Parameter>
        <Format>
            <![CDATA[ <b>NodeName2</b><br /> <table><tr><td>iPhone</td><td>{__otcConferenceID__},#,{__otcConferenceCode__}</td></tr></table>]]>
        </Format>
    </Template>
</Templates>

I know I’m doing this incorrectly, and was hoping to get a larger set of eyes on it.

  • 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-17T18:24:10+00:00Added an answer on June 17, 2026 at 6:24 pm
    private string RetrieveFormattedString(XDocument xDoc, string nodeName)
    {
        return xDoc.Descendants("Template")
                    .First(t => t.Element("Name").Value == nodeName)
                    .Element("Format").Value;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is essentially the same as question 765054 on StackOverflow. I'm only asking
I'm asking a question very similar to this one —dare I say identical? An
There was a post 3 months ago asking essentially my question, but I'm reposting
This is essentially the same as asking how to detect that I am running
First up I am asking this question from home =- away from all the
Before asking a question, and before you all get mad because there are a
Before answering this question, understand that I am not asking how to create my
To begin with, let me apologise for asking yet another question referring this topic.
I am asking a follow-on question to help the OP from a SuperUser question
I realize that this question is not unlike asking someone for the name of

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.