Welcome! Log In Create A New Profile

Advanced

.id is transformed to .ID in WD - any ideas to turns this Off?

Posted by SteveSitas 
.id is transformed to .ID in WD - any ideas to turns this Off?
March 16, 2021 03:33PM
Hi,
I have a situation where ".id" is automatically transformed to ".ID" in the WD editor (v25).
Since id is an XML node - case sensitive - I need to STOP Windev from transforming it to ID ...

Any Ideas?

Regards
Steven Sitas
htis happens because .ID is a property of multiple objects...

However, this happens ONLY when .id is typped as is, if it is between quotes or inside a string, it does not happen...

As we don't know the exact 'situation' you are talking about, I cannot be more specific, but the basic idea if you don't want it transformed is to put it between quotes
Re: .id is transformed to .ID in WD - any ideas to turns this Off?
March 16, 2021 04:21PM
Hi,
This is an XML node assignment - so it can't be done with a string or quotes - WD returns an error ..

I need this:
tempString = NODEInvoice.invoiceDetails.incomeClassification[n].id
and the WD editor transforms it to this:
tempString = NODEInvoice.invoiceDetails.incomeClassification[n].ID

where:
NODEInvoice is xmlNode

Steven Sitas
Re: .id is transformed to .ID in WD - any ideas to turns this Off?
March 16, 2021 04:38PM
Hi,
I used ExecuteCode() to bypass the problem - I am a little short on time these days ...
But there must be a simpler solution

Regards
Steven Sitas
Indirections would probably do the trick
Re: .id is transformed to .ID in WD - any ideas to turns this Off?
March 17, 2021 08:27AM
Hi Steve

Did you load a sample XML file or the XML definition into the "External descriptions" folder in the project explorer or added them to the project?
In that case, WX would simply case it in accordance to the definition and provide you all teh fun of type ahead, compilation warnings etc...

SampleXMLDoc is XMLDocument <description="samplexmldoc">
SampleXMLNode is XMLNode <description="samplexmldoc.samplenode">

For EACH SampleXMLNode of SampleXMLDoc
   SomeValue is string = SampleXMLNode.id..value
...

End

Cheers

Peter



Edited 2 time(s). Last edit at 03/17/2021 08:29AM by PeHoBe.
Re: .id is transformed to .ID in WD - any ideas to turns this Off?
March 17, 2021 12:00PM
Hi Peter,

I have added the XSD to "external descriptions" _AND_ the XSD has ".id" instead of ".ID"

This code works exactly as you describe it:
cMyDoc is xmlDocument <description="InvoicesDoc-v1_0_2">
//and I can use ".id" on the cMyDoc variable with NO problem

But this code shows "the erratic behavior":

NODEInvoice is xmlNode
FOR EACH NODEInvoice OF sResultXMLDocument.RequestedDoc.invoicesDoc
j = NODEInvoice.invoiceDetails..Occurrence
FOR i=1 TO j
// Should be this
// tempString= NODEInvoice.invoiceDetails.id

// WD changes it to this
tempString= NODEInvoice.invoiceDetails.ID

end
end

BTW when you use xmlNode and go to a certain "depth", autocomplete is "rubbish".
I just want it out of my way smiling smiley

Regards
Steven Sitas
Re: .id is transformed to .ID in WD - any ideas to turns this Off?
March 17, 2021 06:12PM
Hi Steven

I didn't see you declared the XMLNode with its definition.
Did you try:
SampleXMLNode is XMLNode <description="samplexmldoc.node.node.samplenode">
Next do a "for each XMLNode of XMLDoc.node" etc...

Cheers

Peter
Re: .id is transformed to .ID in WD - any ideas to turns this Off?
March 18, 2021 12:25PM
Hi Peter,
Thanks - I will give it a try.

Regards
Steven Sitas
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: