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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:38:02+00:00 2026-06-01T03:38:02+00:00

I have an XML string like <Segment xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:type=Air> <carrier /> … </Segment> I

  • 0

I have an XML string like

<Segment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Air">
   <carrier />
   ...
</Segment>

I use JSON.NET to convert that to JSON and the end result has the following members

@xmlns:xsi: "http://www.w3.org/2001/XMLSchema-instance"
@xsi:type: "Air"
carrier

At client end, how do I access the type “Air”? Segment.@xsi:type obviously is illegal.

  • 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-01T03:38:04+00:00Added an answer on June 1, 2026 at 3:38 am

    I presume you use Json.Net at client end.

    XmlDocument xDoc = new XmlDocument();
    xDoc.LoadXml(xstr);
    string jsonText = JsonConvert.SerializeXmlNode(xDoc);
    
    
    JObject jObj = (JObject)JsonConvert.DeserializeObject(jsonText);
    string air = jObj["Segment"]["@xsi:type"].ToString();
    //or
    dynamic jObj = JsonConvert.DeserializeObject(jsonText);
    string air = jObj.Segment["@xsi:type"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have XML as below which I am loading into XDocument <ConversionSpecification xmlns=http://tempuri.org/X12ParserSpecification.xsd TransactionSetIdentifierCode=837>
I have stored the XML path to items in a string like this: response->items->item
I have a complete XML document in a string and would like a Document
I have an XML file, which I open in F# like this: let Bookmarks(xmlFile:string)
I have a string that represents a non indented XML that I would like
I am writing an XML document in C#. I have something like this... string
Say, I have an XML String like this, <METHOD>foo</METHOD> <PARAM1>abc</PARAM1> <PARAM2>def</PARAM2> ... <PARAM99>ghi</PARAM99> <PARAM100>jkl</PARAM100>
I use a xml_parser to parse an xml. When I have a string like
i want parse xml file, which does't have xml extension, like this: http://bizonek.wrzuta.pl/xml/plik/1ANdXCgTOit/unknow/undefined/643/ my
I have a Java string which looks like this, it is actually an XML

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.