C# Class OfficeOpenXml.XmlHelper

Help class containing XML functions. Can be Inherited
Exibir arquivo Open project: pruiz/EPPlus Class Usage Examples

Private Properties

Property Type Description
CreateComplexNode System.Xml.XmlNode
CreateComplexNode System.Xml.XmlNode
CreateComplexNode System.Xml.XmlNode
CreateNode System.Xml.XmlNode
CreateNode System.Xml.XmlNode
DeleteAllNode void
DeleteNode void
DeleteTopNode void
ExistNode bool
GetNewUri System.Uri
GetNewUri System.Uri
GetNodePos int
GetPrependNode System.Xml.XmlNode
GetXmlNodeBool bool
GetXmlNodeBool bool
GetXmlNodeBoolNullable bool?
GetXmlNodeDecimal decimal
GetXmlNodeDouble double
GetXmlNodeDoubleNull double?
GetXmlNodeInt int
GetXmlNodeIntNull int?
GetXmlNodeString string
GetXmlNodeString string
InserAfter void
LoadXmlSafe void
LoadXmlSafe void
SetXmlNodeBool void
SetXmlNodeBool void
SetXmlNodeString void
SetXmlNodeString void
SetXmlNodeString void
SetXmlNodeString void
SetXmlNodeString void
XmlHelper System
XmlHelper System

Private Methods

Method Description
CreateComplexNode ( XmlNode topNode, string path ) : XmlNode

Create a complex node. Insert the node according to the path using the topNode as the parent

CreateComplexNode ( XmlNode topNode, string path, eNodeInsertOrder nodeInsertOrder, XmlNode referenceNode ) : XmlNode

Creates complex XML nodes

1. "d:conditionalFormatting" 1.1. Creates/find the first "conditionalFormatting" node 2. "d:conditionalFormatting/@sqref" 2.1. Creates/find the first "conditionalFormatting" node 2.2. Creates (if not exists) the @sqref attribute 3. "d:conditionalFormatting/@id='7'/@sqref='A9:B99'" 3.1. Creates/find the first "conditionalFormatting" node 3.2. Creates/update its @id attribute to "7" 3.3. Creates/update its @sqref attribute to "A9:B99" 4. "d:conditionalFormatting[@id='7']/@sqref='X1:X5'" 4.1. Creates/find the first "conditionalFormatting" node with @id=7 4.2. Creates/update its @sqref attribute to "X1:X5" 5. "d:conditionalFormatting[@id='7']/@id='8'/@sqref='X1:X5'/d:cfRule/@id='AB'" 5.1. Creates/find the first "conditionalFormatting" node with @id=7 5.2. Set its @id attribute to "8" 5.2. Creates/update its @sqref attribute and set it to "X1:X5" 5.3. Creates/find the first "cfRule" node (inside the node) 5.4. Creates/update its @id attribute to "AB" 6. "d:cfRule/@id=''" 6.1. Creates/find the first "cfRule" node 6.1. Remove the @id attribute

CreateComplexNode ( string path ) : XmlNode

Create a complex node. Insert the node according to SchemaOrder using the TopNode as the parent

CreateNode ( string path ) : XmlNode
CreateNode ( string path, bool insertFirst ) : XmlNode
DeleteAllNode ( string path ) : void
DeleteNode ( string path ) : void
DeleteTopNode ( ) : void
ExistNode ( string path ) : bool
GetNewUri ( Package package, string sUri ) : Uri
GetNewUri ( Package package, string sUri, int id ) : Uri
GetNodePos ( string nodeName ) : int
GetPrependNode ( string nodeName, XmlNode node ) : XmlNode

return Prepend node

GetXmlNodeBool ( string path ) : bool
GetXmlNodeBool ( string path, bool blankValue ) : bool
GetXmlNodeBoolNullable ( string path ) : bool?
GetXmlNodeDecimal ( string path ) : decimal
GetXmlNodeDouble ( string path ) : double
GetXmlNodeDoubleNull ( string path ) : double?
GetXmlNodeInt ( string path ) : int
GetXmlNodeIntNull ( string path ) : int?
GetXmlNodeString ( XmlNode node, string path ) : string
GetXmlNodeString ( string path ) : string
InserAfter ( XmlNode parentNode, string beforeNodes, XmlNode newNode ) : void

Insert the new node before any of the nodes in the comma separeted list

LoadXmlSafe ( XmlDocument xmlDoc, Stream stream ) : void
LoadXmlSafe ( XmlDocument xmlDoc, string xml ) : void
SetXmlNodeBool ( string path, bool value ) : void
SetXmlNodeBool ( string path, bool value, bool removeIf ) : void
SetXmlNodeString ( XmlNode node, string path, string value ) : void
SetXmlNodeString ( XmlNode node, string path, string value, bool removeIfBlank ) : void
SetXmlNodeString ( XmlNode node, string path, string value, bool removeIfBlank, bool insertFirst ) : void
SetXmlNodeString ( string path, string value ) : void
SetXmlNodeString ( string path, string value, bool removeIfBlank ) : void
XmlHelper ( XmlNamespaceManager nameSpaceManager ) : System
XmlHelper ( XmlNamespaceManager nameSpaceManager, XmlNode topNode ) : System