Subject Re: Setvar in xmldocument
From Kiron Joseph <kiron@datadevices.com>
Date Wed, 04 Mar 2020 16:45:00 +0530
Newsgroups xb2net


Hi,

I also have the same issue. Anybody can correct the below sample ?

Regards
Kiron

On Sat, 01 Sep 2012 16:37:47 -0600, Guillermo  <> wrote:

>Thank Boris
>I tested with xbComplexType, but I can not see the change to the method: AsString () ... Look my code..
>
>
>//-----------------------------------------------------------------------------
>#include "xb2net.ch"
>#include "common.ch"
>#pragma  library ("xb2net.lib")
>#xtranslate NTrim(<n>) =>  LTrim(Str(<n>))
>//-----------------------------------------------------------------------------
>
>function Main()
>
>   Local oHttp, oResponse, oForm, cColor, cMensaje      , oxml, oIntegrante
>
>
>text into cMensaje trimmed
>
><?xml version="1.0" encoding="ISO-8859-1"?>
><mensaje>
>        <identificador>
>                <userlogon>
>                        <matriz>VN6344</matriz>
>                        <usuario>0</usuario>
>                        <password>201238</password>
>                </userlogon>
>                <medio>https</medio>
>                <formatoInforme>H</formatoInforme>
>                <reenvio/>
>                <producto>RISC:Experto</producto>
>                <lote>
>            <cliente>TRA-995721</cliente>
>            <fechaHora>2010-02-18T10:00:03.099</fechaHora>
>                </lote>
>        </identificador>
>        <consulta>
>                <integrantes>1</integrantes>
>                <integrante valor="1">
>                        <nombre></nombre>
>                        <sexo></sexo>
>                        <documento></documento>
>                </integrante>
>        </consulta>
></mensaje>
>
>endtext
>
>        oXml := xbXMLDocument():new(cMensaje)
>
>?        oXml:GetVar({"mensaje","consulta","integrante"})
>
>? 'Antes'
>
>?        oXml:GetVar({"mensaje","consulta","integrante","nombre"})
>?        oXml:GetVar({"mensaje","consulta","integrante","sexo"})
>?        oXml:GetVar({"mensaje","consulta","integrante","documento"})
>
>        oIntegrante := oXml:GetVar({"mensaje","consulta","integrante"})
>
>        oIntegrante:SetVar("nombre","Sanzeri, Guillermo")
>        oIntegrante:SetVar("sexo","M")
>        oIntegrante:SetVar("documento",18107042)
>
>? 'Despues'
>
>?        oXml:GetVar({"mensaje","consulta","integrante","nombre"})
>?        oXml:GetVar({"mensaje","consulta","integrante","sexo"})
>?        oXml:GetVar({"mensaje","consulta","integrante","documento"})
>
>
>? 'XML String '
>
>        cMensaje := oXml:AsString()
>
>    MemoEdit(cMensaje, Row()+1, 0, MaxRow(), MaxCol())
>
> Return .t.
>
>//-----------------------------------------------------------------------------
>
>
>
>Boris Borzic <support(at)xb2(dot)net> Wrote:
>
>> The "nombre" tag is nested several levels within the XML. You need to use
>> xbComplexType to get at the correct element. See the docs.
>>
>> --
>> Best regards,
>> Boris Borzic
>>
>> http://xb2.net
>> http://sqlexpress.net
>> industrial strength Xbase++ development tools
>>
>>
>>
>>
>> Guillermo  <> wrote in news:kedbglc1uoh7kj5.310820121524@WIN-SRT7GF05O4J:
>>
>> > I need change this values in the xml document
>> >
>> >               <nombre>Sistematica, ingenieria</nombre>
>> >               <sexo>S</sexo>
>> >               <documento>30650186571</documento>
>> >                
>> > .... , but i cant with setvar method
>> >
>> >      oIntegrante:SetVar("nombre","Sanzeri, Guillermo") --> d ont work
>>

Recent messages in this thread
 
-# Re: Setvar in xmldocument (Current message) Kiron Joseph 04-Mar-2020 06:15 am
.-# Re: Setvar in xmldocument Andreas Gehrs-Pahl 04-Mar-2020 03:13 pm
..|# Re: Setvar in xmldocument Osvaldo Ramirez 04-Mar-2020 08:09 pm
..-# Re: Setvar in xmldocument Andreas Gehrs-Pahl 04-Mar-2020 09:28 pm
...\# Re: Setvar in xmldocument Boris Borzic <bb> 04-Mar-2020 10:27 pm