Subject Re: Setvar in xmldocument
From Osvaldo Ramirez <>
Date Wed, 4 Mar 2020 18:09:09 -0700
Newsgroups xb2net

On 04/03/20 13:13, Andreas Gehrs-Pahl wrote:
> The problem is the following:
> Changing the values of an xbComplexType that is part of the XML Document
> will only update the :XMLArray and :VarList iVars, but not the :eDocument
> iVar, which contains the (original) XML text.
> It will also leave the :IsEncoded iVar set to TRUE, which apparently
> controls how the :AsString() method works.
> Because :IsEncoded is TRUE, the :AsString() method just prints the
> (unchanged) :eDocument iVar, rather than re-parsing :XMLArray or VarList.
> There is an easy workaround for this, though:
> Before using oXML:AsString(), add the following two lines:
> oXML:AddVar("Unique_Dummy_Variable_Not_Otherwise_Used", "")
> oXML:SetVar("Unique_Dummy_Variable_Not_Otherwise_Used")
> The first line will add a new (empty) Variable to the XML Document, which
> will set the :IsEncoded iVar to FALSE. The second line removes that new
> variable again.
> Because the :IsEncoded iVar is now FALSE, the :AsString() method will
> re-parse the XML Document and update the :eDocument iVar, which it will
> then return. It will also set the :IsEncoded iVar back to TRUE, so that the
> next time the :AsString() method is called, it will just return the existing
> :eDocument iVar, to save time.
> Hope that helps,
> Andreas

I didnt know it

Thanks a lot Andreas!!!
Best Regards
Osvaldo Ramirez

Recent messages in this thread
-# Re: Setvar in xmldocument 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 (Current message) 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