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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:49:19+00:00 2026-06-14T18:49:19+00:00

I use LINQ to XML for working with PackageContents.xml file, created by Autodesk company.

  • 0

I use LINQ to XML for working with PackageContents.xml file, created by Autodesk company. Company has defined the structure of this XML file here, but without XSD schema.

I have a problem: This company breaks his the rules… Often the case of elements and attributes is invalid. For example, instead of the “URL” attribute the “Url” attribute can be defined (different casing).

But case is important for XML (or, in English):

Like element names, attribute names are case-sensitive and must start
with a letter or underscore.

The “URL” is not equals “Url” – such attribute will not found.

Can I solve this problem through LINQ to XML (or other), or I can’t?

  • 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-14T18:49:20+00:00Added an answer on June 14, 2026 at 6:49 pm

    While it’s correct that myXelement.Attribute("URL") would require the correct case, there’s nothing stopping you doing

    var attribute = x.Attributes()
                     .SingleOrDefault(xa => 
                         string.Equals(xa.Name.LocalName, 
                                       "Url", 
                                       StringComparison.InvariantCultureIgnoreCase));
    

    Wrap this up in a suitable extension or static helper method and your consuming code shouldn’t be too bad.

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

Sidebar

Related Questions

I try to use XDocument (XML Linq) to save and load classes. For this
how i can add new tag in xml file by use linq to xml
I'm trying to use LINQ to XML to create an Excel spreadsheet. I created
I have to parse large XML file in C#. I use LINQ-to-XML. I have
I've been working with the xml.linq classes in .net recently. But may need to
Trying to use Linq to SQL for a small project I'm working on at
I want to use LINQ to convert this IEnumerable<int>[] value1ByType = new IEnumerable<int>[3]; value1ByType[0]=
Can I use Linq-to-xml to persist my object state without having to use/know Xpath
I'm always so excited to get a chance to use linq to xml and
I have this XML file of size 2.8GB (Polish Wikipedia dump). I have to

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.