Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IXmlNode problems
#1
Hi,
How come this works:

Macro
Code:
Copy      Help
str-- CCxmlfile="Test.xml"        
if(!dir(CCxmlfile)) _s="<Category1></Category1>"; _s.setfile(CCxmlfile) ;;first time, create new file with no data        
IXml-- CCxml
CCxml=CreateXml
CCxml.FromFile(CCxmlfile)
IXmlNode-- CCxrt = CCxml.RootElement ;;this will be often used    

str Child1="hello"
str ChildAttributes="1[]3[]5"

CCxrt.SetChild(Child1 ChildAttributes)    

CCxml.ToFile(CCxmlfile)

But the following throws this error: Error (RT) in Macro2: 0x80070057, The parameter is incorrect.
Note that the error cursor is always blinking at the CCxrt.SetChild line


Macro
Code:
Copy      Help
str-- CCxmlfile="Test.xml"        
if(!dir(CCxmlfile)) _s="<Category1></Category1>"; _s.setfile(CCxmlfile) ;;first time, create new file with no data        
IXml-- CCxml
CCxml=CreateXml
CCxml.FromFile(CCxmlfile)
IXmlNode-- CCxrt = CCxml.RootElement ;;this will be often used    

str Child1
Acc a=acc(50 43 0 2);err
Child1=a.Name    

str ChildAttributes="1[]3[]5"

CCxrt.SetChild(Child1 ChildAttributes)    

CCxml.ToFile(CCxmlfile)

Note that Child1 from Acc a is usually a 7 digit number but could be alphanumeric string.

Thanks for any help,
Stuart


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)