Ok, here is where I am at now.
I can put [text]xml_result[text] =in thedocument and it will display the returned xml in my browser. So I assume th=at Iam getting all the information ok.
However when I use the following:
[writefilefile=3Dxml_response][xml_result][/writefile]
[xmlparse var=3Dxml_var1][include file=3Dxml_response][/xmlparse]
[xmlnodes ref=3Dxml_var1&path=3Dnamed:PNAResponse]
[name]=3D[value]<br>
&nbs=p; &=nbsp; [xmlnodes]
&nbs=p; &=nbsp; &nbs=p; - [name]=3D[value]<br>
&nbs=p; &=nbsp; [/xmlnodes]
[/xmlnodes]
What I am seeing now in the browser is:
&n=bsp;FatalError at file
line: 1
column: 1
message: Invalid document structure
An unknown error occurred:
XMLNodes
Container/Path Not Found:
xml_var1
I think there is a problem with the way the writefile is wri=tingthe file. This is because if I copy and paste the [text]xml_result[text]= =I usedabove and physically save it to a test.xml file I get the same errormessage. Then I saw that the message was referring to line: 1 column:=1and decided to delete the two leading spaces in the text.xml file and then =itdisplayed the same error message, but referring to line:2 column:1. So Ideleted the deleted the leading – and space, and now itdisplays correctly. So if this is the reason for getting the error using =span>[writefilefile=3Dxml_response][xml_result][/writefile] how do I fix it?
Mark
From: Marc Thompson[mailto:mthompson@media.utah.edu]
Sent: Friday, September 11, 2009 10:51 PM
To: talk@webdna.us
Subject: RE: [WebDNA] XML Help
Why is the write file commented out? Remove the[!][/!] around the write file context.
Marc
From: Mark Bergkvist [mark@pcchoice.com]
Sent: Friday, September 11, 2009 4:12 PM
To: talk@webdna.us
Subject: RE: [WebDNA] XML Help
Ok, here is what I have to write the response to a variable:=
[text]xml_result=3D[middle startafter=3D<?xmlversion=3D"1.0"?>&endbefore=3D]
[tcpconnect host=3Dnewport.ingrammicro.com&port=3D443&am=p;ssl=3DT]
[tcpsend skipheader=3DT][!]
[/!]POST /mustang HTTP/1.0[crlf][!]
[/!]Host: [host][crlf][!]
[/!]Content-Length: [CountChars][content][/CountChars][crlf]=[!]
[/!][crlf][!]
[/!][content][!]
[/!][/tcpsend]
[/tcpconnect][/middle][/text]
[!][writefile file=3Dxml_response][xml_result][/writefile][/=!]
[xmlparsevar=3Dxml_var1][include file=3Dxml_response][/xmlparse]
[xmlnodesref=3Dxml_var1&path=3Dnamed:PNAResponse]
[name]=3D[value]<br>
= &nb=sp; [xmlnodes]
= &nb=sp; = - [name]=3D[value]<br>
= &nb=sp; [/xmlnodes]
[/xmlnodes]
What I am seeing now in the browser is:
Fatal Error at file
line: 1
column: 1
message: Invalid document structure
An unknown error occurred:
XMLNodes
Container/Path Not Found:
xml_var1
Any idea if I am missing something here?
Mark
From: Kenneth Grome[mailto:kengrome@gmail.com]
Sent: Friday, September 11, 2009 5:47 PM
To: talk@webdna.us
Subject: Re: [WebDNA] XML Help
>How would I save it directly into the XMLParse context?
Putthe tcpconnect inside the xmlparse context, or in the xmlparse tag itself -=- Iforgot which but it's in the docs.
Onthe other hand your code will be clearer and easier to understand if you ju=stsave the tcpconnect response as a text variable then use that variable in t=hexmlparse context.
Sincerely,
Ken Grome
|
Ok, here is where I am at now.
I can put [text]xml_result[text] =in thedocument and it will display the returned xml in my browser. So I assume th=at Iam getting all the information ok.
However when I use the following:
[writefilefile=3Dxml_response][xml_result][/writefile]
[xmlparse var=3Dxml_var1][include file=3Dxml_response][/xmlparse]
[xmlnodes ref=3Dxml_var1&path=3Dnamed:PNAResponse]
[name]=3D[value]<br>
&nbs=p; &=nbsp; [xmlnodes]
&nbs=p; &=nbsp; &nbs=p; - [name]=3D[value]<br>
&nbs=p; &=nbsp; [/xmlnodes]
[/xmlnodes]
What I am seeing now in the browser is:
&n=bsp;FatalError at file
line: 1
column: 1
message: Invalid document structure
An unknown error occurred:
XMLNodes
Container/Path Not Found:
xml_var1
I think there is a problem with the way the writefile is wri=tingthe file. This is because if I copy and paste the [text]xml_result[text]= =I usedabove and physically save it to a test.xml file I get the same errormessage. Then I saw that the message was referring to line: 1 column:=1and decided to delete the two leading spaces in the text.xml file and then =itdisplayed the same error message, but referring to line:2 column:1. So Ideleted the deleted the leading – and space, and now itdisplays correctly. So if this is the reason for getting the error using =span>[writefilefile=3Dxml_response][xml_result][/writefile] how do I fix it?
Mark
From: Marc Thompson[mailto:mthompson@media.utah.edu]
Sent: Friday, September 11, 2009 10:51 PM
To: talk@webdna.us
Subject: RE: [WebDNA] XML Help
Why is the write file commented out? Remove the[!][/!] around the write file context.
Marc
From: Mark Bergkvist [mark@pcchoice.com]
Sent: Friday, September 11, 2009 4:12 PM
To: talk@webdna.us
Subject: RE: [WebDNA] XML Help
Ok, here is what I have to write the response to a variable:=
[text]xml_result=3D[middle startafter=3D<?xmlversion=3D"1.0"?>&endbefore=3D]
[tcpconnect host=3Dnewport.ingrammicro.com&port=3D443&am=p;ssl=3DT]
[tcpsend skipheader=3DT][!]
[/!]POST /mustang HTTP/1.0[crlf][!]
[/!]Host: [host][crlf][!]
[/!]Content-Length: [countchars][content][/CountChars][crlf]=[!]
[/!][crlf][!]
[/!][content][!]
[/!][/tcpsend]
[/tcpconnect][/middle][/text]
[!][writefile file=3Dxml_response][xml_result][/writefile][/=!]
[xmlparsevar=3Dxml_var1][include file=3Dxml_response][/xmlparse]
[xmlnodesref=3Dxml_var1&path=3Dnamed:PNAResponse]
[name]=3D[value]<br>
= &nb=sp; [xmlnodes]
= &nb=sp; = - [name]=3D[value]<br>
= &nb=sp; [/xmlnodes]
[/xmlnodes]
What I am seeing now in the browser is:
Fatal Error at file
line: 1
column: 1
message: Invalid document structure
An unknown error occurred:
XMLNodes
Container/Path Not Found:
xml_var1
Any idea if I am missing something here?
Mark
From: Kenneth Grome[mailto:kengrome@gmail.com]
Sent: Friday, September 11, 2009 5:47 PM
To: talk@webdna.us
Subject: Re: [WebDNA] XML Help
>How would I save it directly into the XMLParse context?
Putthe tcpconnect inside the xmlparse context, or in the xmlparse tag itself -=- Iforgot which but it's in the docs.
Onthe other hand your code will be clearer and easier to understand if you ju=stsave the tcpconnect response as a text variable then use that variable in t=hexmlparse context.
Sincerely,
Ken Grome
DOWNLOAD WEBDNA NOW!
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...