Configuration XML

0

I'm having trouble understanding an XML case

The task I have to do is the following

  

If in the register of at least one input, the storage center   (esmart table, field10) for EXTC or system considers that it is   processing. What I need to do is change this CA (Storage Center), because there was a   need to register a new one and we need this   information is not fixed in the program. The information can be   database or configuration XML

Although I see some examples in google, I did not understand how to put this XML information in Configuration

My XML:

<?xml version="1.0" encoding="utf-8" ?>
<Database>
  <registro>
    <provider>msdaora</provider>
    <idioma1>Português</idioma1>
    <idioma2>Español</idioma2>
    <idioma3>English</idioma3>
    <smtp>smtp.'...'.com.br</smtp>
    <limitelinhas>1000</limitelinhas>
    <notificacao>[email protected]</notificacao> 
    <SCA>http://localhost/sca/WebService/Acesso.asmx</SCA>
    <GARANTIAConnectionString>Data Source = desenvolvimento; User Id = kawasaki; Password = teste</GARANTIAConnectionString>
    <PECASConnectionString>Data Source = desenvolvimento; User Id = kawasaki; Password = teste</PECASConnectionString>
    <ERPSPConnectionString>Data Source = kmb; User Id = kawasaki_Pennagh; Password = kwl0026_Pennagh</ERPSPConnectionString>
    <ERPMAConnectionString>Data Source = kmbma; User Id = kawasaki; Password = kwl0026</ERPMAConnectionString>
    <ERPConnectionString>Data Source = orclprd; User Id = kawasaki; Password = teste</ERPConnectionString>
    <RELPECASConnectionString>Data Source = ORCL10; User Id = kawasaki_Pennagh; Password = kwl0026_Pennagh</RELPECASConnectionString>
    <corporationConnectionString>Data Source = desenvolvimento; User Id = kawasaki; Password =desenvolvimento</corporationConnectionString>
    <PennaghAMTSTConnectionString>Data Source = Pennagh; User Id = PennaghTESTE; Password = PennaghTESTE</PennaghAMTSTConnectionString>
    <PennaghAMPRDConnectionString>Data Source = Pennagh; User Id = PennaghTESTE; Password = PennaghTESTE</PennaghAMPRDConnectionString>
    <PennaghSPPRDConnectionString>Data Source = ORCL10; User ID = kawasaki_Pennagh; Password = kwl0026_Pennagh</PennaghSPPRDConnectionString>
    <KCAAMConnectionString>Data Source = Pennagh; User Id = PennaghCOMPONENTETESTE; Password = PennaghCOMPONENTETESTE</KCAAMConnectionString>    
    <PEDConnectionString>Data Source = desenvolvimento; User Id = kmbpedvei; Password = teste</PEDConnectionString>     
    <HWMSConnectionString></HWMSConnectionString>
  </registro>
</Database> 
    
asked by anonymous 17.06.2014 / 14:06

1 answer

1

Follows a very good first xml reading site, link

Just to improve the explanation, XML is made up of us parents and child nodes, that is, in your XML has:

<Database> -----> Nó Pai
  <registro> ----> Nó Filho (Cabeçalho)
    <provider>msdaora</provider> ----> Nó de Itens
    <idioma1>Português</idioma1> ----> Nó de Itens
    <idioma2>Español</idioma2>   ----> Nó de Itens
    ...
  </registro> 
</Database> 

It's all about attention, make your own variables, and you'll understand XML right.

In order to read the items, it is mandatory to read the Parent Node, the Child Node (Header), and then the items ... an example in Delphi that I did.

NoPai := xmldoc_nfe.DocumentElement.ChildNode['Database'];
NoFilho := NoPai.ChildNode['registro'];
NoItem := NoFilho.ChilNode['provider'].Text; 
NoItem2 := NoFilho.ChilNode['idioma1'].Text;
NoItem3 := NoFilho.ChilNode['idioma2'].Text;

The logic is this one, I hope it has helped.

    
17.06.2014 / 16:02