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

The Archive Base Latest Questions

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

I recently read the IXmlSerializable interface information on MSDN and was a little confused

  • 0

I recently read the IXmlSerializable interface information on MSDN and was a little confused about the whole end tag thing.

As I understand it, if you are implementing IXmlSerializable then you do not need to write the end tag, but you do need to read it? E.g. the following would error if my class A does not read the end tag

<A>
   <i>32</i>
</A>

But what happens if the content is

<A i="32"/>

If I attempt to read the end tag here I get an InvalidOperationException. But if I read on to determine what I’m supposed to be reading is that not going to much up the position of the reader?

I think I’m just getting a little lost, as the code I’m working with gets a bit more complex when I have to deal with IXmlSerializable children (which can be of varying types), and collections of IXmlSerializable elements.

  • 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-05-12T05:54:20+00:00Added an answer on May 12, 2026 at 5:54 am

    Both XmlReader and XPathNavigator implement a property called IsEmptyElement.

    From the documentation:

    When overridden in a derived class, gets a value indicating whether the current node is an empty element without an end element tag.

    So when you see a start-element event, if IsEmptyElement is true you should not look for an end-element event. The start-element event acts as both start and end for that case.

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

Sidebar

Related Questions

I recently read a question on here about static and dynamic linking, which reminded
I recently read this thread on MSDN . So I was thinking of using
I recently read about labelled statments in java and the ability to specify a
I just recently read about Mocking objects for unit testing and currently I'm having
I am new in flex and recently read about Validation and Invalidation in components
I recently read a jQuery tutorial about best practices. I usually run all my
I recently read a question about a simple, secure API authentication system and see
I recently read about http://php.net/pcntl and was woundering how good that functions works and
I recently read about quicksort and was wondering whether it would be smart to
I recently read about a new Google-code hosted (open source) project from Google that

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.