Configuration XML

Asked

Viewed 85 times

0

I’m having trouble understanding an XML case

The task I have to do is this:

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

Although I see some examples in google, I did not understand how I put this information in XML 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> 
  • What language you have to work with, buddy?

  • Vb.net, sorry I forgot to tag

1 answer

1


Follow a very good website for first reading xml, http://www.macoratti.net/10/08/vbn_xml1.htm

Just to improve the explanation, XML is made up of parents and children, 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 anyway, make your own variables and you will understand the XML right.

Remembering... to read the items, it is mandatory to read the Parent Node, the Son 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;

That’s the logic, I hope it helped.

  • Cara helped this explanation a lot. I had heard of Nópai and Nófilho, but I didn’t understand it until now. Thank you very much !

  • Thanks man, I’m glad you helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.