RE: [WebDNA] XML Help
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103624
interpreted = N
texte = Christer,I understand about using the XML directly and via a writefile, both ways se=em to be working just fine.I have also already worked with the commands to remove whitespaces to no av=ail.I have created a test account so I could post my entire code here if anyone= would like to help me figure out why I am getting the "Fatal Error" messag=es. The test account I setup will allow you to see the returned XML.[text]crlf=3D[unurl]%0D%0A[/unurl][/text][text]content=3D
2.0MDYOUMDPcTest747gPcTest382E123451[/text][text]XMLresult=3D[middle startafter=3D&endbefore=3D=][tcpconnect host=3Dnewport.ingrammicro.com&port=3D443&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=3DtheResponse.xml][XMLresult][/writefile] [xmlparse var=3Dxml_var1][include file=3DtheResponse.xml][/xmlparse=] [xmlnodes ref=3Dxml_var1&path=3Dnamed:PNAResponse] [name]=3D[value]
[xmlnodes] - [name]=3D[value]
[/xmlnodes] [/xmlnodes]Thanks!Mark-----Original Message-----From: Christer Olsson [mailto:christer@ljusaideer.se]Sent: Sunday, September 13, 2009 9:42 AMTo: talk@webdna.usSubject: Re: [WebDNA] XML HelpMark,as I posted previously; you don't have to write your XML to a file.Just use it directly:[xmlparse var=3Dxml_var1][xml_result][/xmlparse]To remove whitespace you'll have to read up on [GetChars], [Middle]and [Grep] portions of the WebDNA docs.Best,Christer ************************************************************* Christer Olsson PO Box 9160 Phone +46 40 25 85 85 Ljusa Id=E9er AB SE-200 39 Malmo Fax +46 40 25 85 89 Kantyxegatan 5 Sweden http://www.ljusaideer.se12 sep 2009 kl. 18.01 skrev Mark Bergkvist:> Ok, here is where I am at now.>> I can put [text]xml_result[text] in the document and it will display> the returned xml in my browser. So I assume that I am getting all> the information ok.>> However when I use the following:>> [writefile file=3Dxml_response][xml_result][/writefile]>> [xmlparse var=3Dxml_var1][include file=3Dxml_response][/xmlparse]> [xmlnodes ref=3Dxml_var1&path=3Dnamed:PNAResponse]> [name]=3D[value]
> [xmlnodes]> - [name]=3D[value]
> [/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>> I think there is a problem with the way the writefile is writing the> file. This is because if I copy and paste the [text]xml_result[text]> I used above and physically save it to a test.xml file I get the> same error message. Then I saw that the message was referring to> line: 1 column:1 and decided to delete the two leading spaces in the> text.xml file and then it displayed the same error message, but> referring to line:2 column:1. So I deleted the deleted the leading -> and space, and now it displays correctly. So if this is the reason> for getting the error using [writefile file=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&endbefore==3D]> [tcpconnect host=3Dnewport.ingrammicro.com&port=3D443&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][/!]>>> [xmlparse var=3Dxml_var1][include file=3Dxml_response][/xmlparse]> [xmlnodes ref=3Dxml_var1&path=3Dnamed:PNAResponse]> [name]=3D[value]
> [xmlnodes]> - [name]=3D[value]
>> [/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?>>> Put the tcpconnect inside the xmlparse context, or in the xmlparse> tag itself -- I forgot which but it's in the docs.>>> On the other hand your code will be clearer and easier to understand> if you just save the tcpconnect response as a text variable then use> that variable in the xmlparse context.>>> Sincerely,> Ken Grome>>---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list
.To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usold archives: http://dev.webdna.us/TalkListArchive/Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D=288
Associated Messages, from the most recent to the oldest:
Christer,I understand about using the XML directly and via a writefile, both ways se=em to be working just fine.I have also already worked with the commands to remove whitespaces to no av=ail.I have created a test account so I could post my entire code here if anyone= would like to help me figure out why I am getting the "Fatal Error" messag=es. The test account I setup will allow you to see the returned XML.[text]crlf=3D[unurl]%0D%0A[/unurl][/text][text]content=3D2.0MDYOUMDPcTest747gPcTest382E123451[/text][text]XMLresult=3D[middle startafter=3D&endbefore=3D=][tcpconnect host=3Dnewport.ingrammicro.com&port=3D443&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=3DtheResponse.xml][XMLresult][/writefile] [xmlparse var=3Dxml_var1][include file=3DtheResponse.xml][/xmlparse=] [xmlnodes ref=3Dxml_var1&path=3Dnamed:PNAResponse] [name]=3D[value]
[xmlnodes] - [name]=3D[value]
[/xmlnodes] [/xmlnodes]Thanks!Mark-----Original Message-----From: Christer Olsson [mailto:christer@ljusaideer.se]Sent: Sunday, September 13, 2009 9:42 AMTo: talk@webdna.usSubject: Re: [WebDNA] XML HelpMark,as I posted previously; you don't have to write your XML to a file.Just use it directly:[xmlparse var=3Dxml_var1][xml_result][/xmlparse]To remove whitespace you'll have to read up on [getchars], [middle]and [grep] portions of the WebDNA docs.Best,Christer ************************************************************* Christer Olsson PO Box 9160 Phone +46 40 25 85 85 Ljusa Id=E9er AB SE-200 39 Malmo Fax +46 40 25 85 89 Kantyxegatan 5 Sweden http://www.ljusaideer.se12 sep 2009 kl. 18.01 skrev Mark Bergkvist:> Ok, here is where I am at now.>> I can put [text]xml_result[text] in the document and it will display> the returned xml in my browser. So I assume that I am getting all> the information ok.>> However when I use the following:>> [writefile file=3Dxml_response][xml_result][/writefile]>> [xmlparse var=3Dxml_var1][include file=3Dxml_response][/xmlparse]> [xmlnodes ref=3Dxml_var1&path=3Dnamed:PNAResponse]> [name]=3D[value]
> [xmlnodes]> - [name]=3D[value]
> [/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>> I think there is a problem with the way the writefile is writing the> file. This is because if I copy and paste the [text]xml_result[text]> I used above and physically save it to a test.xml file I get the> same error message. Then I saw that the message was referring to> line: 1 column:1 and decided to delete the two leading spaces in the> text.xml file and then it displayed the same error message, but> referring to line:2 column:1. So I deleted the deleted the leading -> and space, and now it displays correctly. So if this is the reason> for getting the error using [writefile file=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&endbefore==3D]> [tcpconnect host=3Dnewport.ingrammicro.com&port=3D443&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][/!]>>> [xmlparse var=3Dxml_var1][include file=3Dxml_response][/xmlparse]> [xmlnodes ref=3Dxml_var1&path=3Dnamed:PNAResponse]> [name]=3D[value]
> [xmlnodes]> - [name]=3D[value]
>> [/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?>>> Put the tcpconnect inside the xmlparse context, or in the xmlparse> tag itself -- I forgot which but it's in the docs.>>> On the other hand your code will be clearer and easier to understand> if you just save the tcpconnect response as a text variable then use> that variable in the xmlparse context.>>> Sincerely,> Ken Grome>>---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usold archives: http://dev.webdna.us/TalkListArchive/Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D=288
Mark Bergkvist
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
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...
Related Readings:
WebCat website for developers and hosters (2001)
FlushDatabase Suggestion (1998)
BR (1997)
CloseDataBase vs CommitDataBase (2007)
Accepting credit cards (1997)
New commands in Final candidate (1997)
2nd WebCatalog2 Feature Request (1996)
Exchange rates (2000)
(2000)
WebMerchant Question (2000)
Search the same field twice? (2004)
Virtual Postcards (1998)
weird G3 happenings (1998)
Nested searches (1998)
Semi-OT SSL IE problem (2005)
Searching an Email database (1997)
tcpconnect feature request .. (2003)
Re:PCS Customer submissions ? (1997)
[WebDNA] Anyone using Ubuntu 17.04 yet? (2017)
Snake Bites (1997)