Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
XText Class

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
XText Class

Represents a text node.

Namespace:  System.Xml.Linq
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)
Visual Basic (Declaration)
Public Class XText _
    Inherits XNode
Visual Basic (Usage)
Dim instance As XText
C#
public class XText : XNode
Visual C++
public ref class XText : public XNode
JScript
public class XText extends XNode

XML elements can contain text content. Sometimes the content is simple (the element only contains text content), and sometimes the content is mixed (the contents of the element contains both text and other elements). In either case, each chunk of text is represented as an XText node.

LINQ to XML developers will often have to write code to work with arbitrary LINQ to XML trees that they did not create. If you are writing code that has to work with LINQ to XML trees that you have no control over creating, you should be aware of certain behaviors of XText nodes.

When processing the contents of an XML tree at the node level, you should be prepared for multiple XText nodes to be adjacent to each other. Further, you should be prepared for XText nodes that contain no text. It is possible through LINQ to XML methods to remove the content of a text node. However, LINQ to XML does not automatically delete the node. The node has identity, and might have annotations, so LINQ to XML allows for zero-length nodes in the tree.

For more information, see Programming with Nodes.

System..::.Object
  System.Xml.Linq..::.XObject
    System.Xml.Linq..::.XNode
      System.Xml.Linq..::.XText
        System.Xml.Linq..::.XCData
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

.NET Compact Framework

Supported in: 3.5

XNA Framework

Supported in: 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker