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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:27:25+00:00 2026-06-11T05:27:25+00:00

Here is my XML : <?xml version=1.0 encoding=utf-8 ?> <Selection> <ID>1</ID> <Nom>Name 1</Nom> <DateReference>0</DateReference>

  • 0

Here is my XML :

  <?xml version="1.0" encoding="utf-8" ?>
   <Selection>
    <ID>1</ID>
    <Nom>Name 1</Nom>
    <DateReference>0</DateReference>
    <PrefixeMedia>Department</PrefixeMedia>
    <FormatExport>1630</FormatExport>
    <TraceAuto>Oui</TraceAuto>
    <SubID></SubID>
  </Selection>
  <Selection>
    <ID>2</ID>
    <Nom>Name 1</Nom>
    <DateReference>0</DateReference>
    <PrefixeMedia>Department</PrefixeMedia>
    <FormatExport>1630</FormatExport>
    <TraceAuto>1</TraceAuto>
    <SubID>1</SubID>
  </Selection>

My problem is I would like to modify for example the node content of <Nom>Name 1</Nom> which is located in <Selection></Selection> which have <ID>1</ID> (Search by ID)

I’m using XElement and XDocument to do simple search but I need some help to solve this problem above. (Developpment on SilverLight

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-11T05:27:27+00:00Added an answer on June 11, 2026 at 5:27 am

    If you don’t know how to get at the correct <Nom> node to update, the trick is to first select a <Selection> node that contains the correct <ID> node, then you can get that <Nom> node.

    Something like:

    XElement tree = <your XML>;
    XElement selection = tree.Descendants("Selection")
          .Where(n => n.Descendants("ID").First().Value == "1") // search for <ID>1</ID>
          .FirstOrDefault();
    if (selection != null)
    {
      XElement nom = selection.Descendants("Nom").First();
      nom.Value = "Name one";
    }
    

    Note 1: By using Descendants("ID").First() I expect every Selection node to contain an ID node.
    Note 2: And every Selection node contains a Nom node
    Note 3: Now you still have to store the whole XML, if that’s what you need.

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

Sidebar

Related Questions

Here's the XML: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <feed xmlns=http://www.w3.org/2005/Atom xmlns:dc=http://purl.org/dc/elements/1.1/> <title>Rated Images</title> <link
Here are three XML-trees (1) <?xml version=1.0 encoding=UTF-8?> <content> <section id=1> <section id=2/> <section
here is my layuout main.xml ; <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent>
Here's a trivial but valid Docbook article: <?xml version=1.0 encoding=utf-8?> <article xmlns=http://docbook.org/ns/docbook version=5.0> <title>I
I made a plist that looks like that: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC
I've this configuration in the hibernate.cfg.xml: <?xml version=1.0 encoding=utf-8 ?> <hibernate-configuration xmlns=urn:nhibernate-configuration-2.2> <session-factory> <property
I have next XML: <?xml version=1.0 encoding=UTF-8?> <mailAndMessageSettings> <settings> <add key=Url value=/> <add key=UserName
I'm having issues with schema validation, this is my xml <?xml version=1.0 encoding=utf-8 ?>
<?xml version=1.0 encoding=utf-8?> <Report p1:schemaLocation=Customer details http://reportserver?%2fCustomer details&amp;rs%3aFormat=XML&amp;rc%3aSchema=True Name=Customer details xmlns:p1=http://www.w3.org/2001/XMLSchema-instance xmlns=Customer details> <table2>
My script returns this xml data from my method: <?xml version='1.0' encoding='utf-8'?><rows><page>1</page><total>1</total><records>1</records><row id='12'><cell>tyutyu</cell></row><row id='11'><cell>yutyyut</cell></row><row

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.