Class StdBSXML
Classe utilizada para obter serviços e regras de negócio sobre a Manipulação de ficheiros XML.
Inheritance
Implements
Inherited Members
Namespace: StdPlatBS100
Assembly: StdPlatBS100.dll
Syntax
[ComVisible(true)]
[Guid("867157CB-F1BC-46D5-9CDD-58B3A5BE4FDF")]
[ClassInterface(ClassInterfaceType.None)]
public class StdBSXML : IStdBSXML
Properties
XML
Devolve o código XML actual.
Declaration
public string XML { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
AddNameSpace(String, String)
Adds the name space.
Declaration
public void AddNameSpace(string prefix, string uri)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix. |
System.String | uri | The URI. |
DecryptNode(String)
Descodifica um nó.
Declaration
public void DecryptNode(string strQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o elemento a descodificar. |
DeleteAttribute(String, String)
Remove um atríbuto.
Declaration
public void DeleteAttribute(string strQuery, string strAttributeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o elemento em que se pretende remover o atríbuto. |
System.String | strAttributeName | Nome do atríbuto a remover. |
DeleteNode(String)
Remoção de um nó.
Declaration
public void DeleteNode(string strQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o nó a remover. |
EncryptNode(String)
Codificação de um nó.
Declaration
public void EncryptNode(string strQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o elemento a encriptar. |
Finalize()
Declaration
protected void Finalize()
FormatXmlDocument(XmlDocument)
Formata o documento com identação progressiva e quebra de linhas.
Declaration
public void FormatXmlDocument(XmlDocument XmlDoc)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | XmlDoc | Documento XML. |
FormatXmlNode(XmlNode, Int32)
Formata o elemento e os seus descendentes com identação progressiva e quebra de linhas.
Declaration
public void FormatXmlNode(XmlNode xmlNode, int intIdent)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | xmlNode | Elemento XML. |
System.Int32 | intIdent | Identação em número de espaços. |
GetChildAttribute(String, String, Int32)
Devolve um atríbuto filho do elemento seleccionado.
Declaration
public string GetChildAttribute(string strQuery, string strName, int lngIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o elemento. |
System.String | strName | Nome do atríbuto. |
System.Int32 | lngIndex | Índice. |
Returns
Type | Description |
---|---|
System.String |
GetChildName(String, Int32)
Devolve o nome de um elemento filho.
Declaration
public string GetChildName(string strQuery, int lngIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o elemento pai. |
System.Int32 | lngIndex | Índice do elemento filho. |
Returns
Type | Description |
---|---|
System.String |
GetChildValue(String, Int32)
Devolve o valor de um elemento filho.
Declaration
public string GetChildValue(string strQuery, int lngIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o elemento pai. |
System.Int32 | lngIndex | Índice do elemento filho. |
Returns
Type | Description |
---|---|
System.String |
GetNode(String)
Devolve um elemento.
Declaration
public XmlNode GetNode(string strQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
Returns
Type | Description |
---|---|
System.Xml.XmlNode |
GetXMLDocumentInfo(StdBSTipos.EnumXMLDocInfoConst)
Devolve a informação do documento XML.
Declaration
public string GetXMLDocumentInfo(StdBSTipos.EnumXMLDocInfoConst enuDesiredInfo)
Parameters
Type | Name | Description |
---|---|---|
StdBSTipos.EnumXMLDocInfoConst | enuDesiredInfo | Tipo de informação pretendida. |
Returns
Type | Description |
---|---|
System.String |
InitXML(String)
Inicialização.
Declaration
public void InitXML(string strRootName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strRootName | Nome do elemento raíz. |
MakeNode(String, String, String[], String[], String)
Construção de um novo nó.
Declaration
public void MakeNode(string strQuery, string strName, string[] strAttrNames, string[] strAttrValues, string vntNodeValue = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o elemento pai. |
System.String | strName | Nome do elemento. |
System.String[] | strAttrNames | Lista de nomes de atríbutos. |
System.String[] | strAttrValues | Lista de valores de atríbutos. |
System.String | vntNodeValue | Valor do elemento. |
MakeSimpleChildNode(XmlElement, String, String)
Construção de um elemento simples (sem atríbutos).
Declaration
public void MakeSimpleChildNode(XmlElement objNode, string strName, string vntNodeValue)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | objNode | Nó pai. |
System.String | strName | Nome do elemento. |
System.String | vntNodeValue | Valor do elemento. |
MakeSimpleNode(String, String, String)
Construção de um elemento simples (sem atríbutos).
Declaration
public XmlElement MakeSimpleNode(string strQuery, string strName, string vntNodeValue = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query para seleccionar o elemento pai. |
System.String | strName | Nome do elemento. |
System.String | vntNodeValue | Valor do elemento. |
Returns
Type | Description |
---|---|
System.Xml.XmlElement |
NodeCount(String)
Devolve a lista de elementos seleccionados.
Declaration
public int NodeCount(string strQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção de elementos. |
Returns
Type | Description |
---|---|
System.Int32 |
OpenXML(String, StdBSTipos.EnumOpenXMLDoc)
Carregamento de código XML.
Declaration
public bool OpenXML(string strSource, StdBSTipos.EnumOpenXMLDoc enuType = StdBSTipos.EnumOpenXMLDoc.oxFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | strSource | Fonte. |
StdBSTipos.EnumOpenXMLDoc | enuType | Tipo de fonte. |
Returns
Type | Description |
---|---|
System.Boolean |
ReadAttribute(String, String)
Devolve um atríbuto do elemento seleccionado.
Declaration
public string ReadAttribute(string strQuery, string strName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
System.String | strName | Nome do atríbuto. |
Returns
Type | Description |
---|---|
System.String |
ReadAttributeIfExists(String, String)
Devolve um atríbuto do elemento seleccionado, ou string vazia caso ele não exista no elemento.
Declaration
public string ReadAttributeIfExists(string strQuery, string strName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
System.String | strName | Nome do atributo. |
Returns
Type | Description |
---|---|
System.String |
ReadNode(String)
Devolve um elemento.
Declaration
public string ReadNode(string strQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
Returns
Type | Description |
---|---|
System.String |
ReadNodeXML(String)
Devolve o código XML de um elemento.
Declaration
public string ReadNodeXML(string strQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção de um elemento. |
Returns
Type | Description |
---|---|
System.String |
Save(String)
Grava a definição do código XML em ficheiro.
Declaration
public void Save(string strFileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strFileName | Nome do ficheiro. |
TryGetNode(String)
Devolve o elemento se existir.
Declaration
public XmlNode TryGetNode(string strQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
Returns
Type | Description |
---|---|
System.Xml.XmlNode |
WriteAttributes(String, String[], String[])
Gravação de atríbutos.
Declaration
public object WriteAttributes(string strQuery, string[] strNames, string[] strValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
System.String[] | strNames | Nomes dos atríbutos. |
System.String[] | strValues | Valores dos atríbutos. |
Returns
Type | Description |
---|---|
System.Object |
WriteChildAttributes(String, Int32, String[], String[])
Gravação de atríbutos filhos.
Declaration
public void WriteChildAttributes(string strQuery, int lngIndex, string[] strAttrNames, string[] strAttrValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
System.Int32 | lngIndex | Índice do filho. |
System.String[] | strAttrNames | Nomes dos atríbutos. |
System.String[] | strAttrValues | Valores dos atríbutos. |
WriteNode(String, String)
Gravação de um elemento.
Declaration
public object WriteNode(string strQuery, string vntValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
System.String | vntValue | Valor. |
Returns
Type | Description |
---|---|
System.Object |
WriteNodeXml(String, XmlNode)
Gravação de um elemento.
Declaration
public object WriteNodeXml(string strQuery, XmlNode xmlNode)
Parameters
Type | Name | Description |
---|---|---|
System.String | strQuery | Query de selecção do elemento. |
System.Xml.XmlNode | xmlNode | Nodo xml. |
Returns
Type | Description |
---|---|
System.Object |