Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    8

    Post Unanswered: Passing recordset objects to XML

    Hi,
    I'm trying to pass ASP recordset to xml, I have no idea how to do this can anyone help, the goal is to send customised text messages from my site at the moment I can send test messages
    xml file...
    <?xml version ="1.0" encoding="ISO-8859-1"?>
    <aspsms>
    <Userkey></Userkey>
    <Password></Password>
    <Recipient>
    <PhoneNumber></PhoneNumber>
    </Recipient>
    <MessageData>Test </MessageData>
    <Action>SendTextSMS</Action>
    </aspsms>

  2. #2
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    ASP record set --> XML is easy

    you would just iterate through the rs ouputting the fields as bellow;

    Code:
    <%
    response.contenttype="text/xml"
    'make the rs and query
    %>
    <?xml version ="1.0" encoding="ISO-8859-1"?>
    <aspsms>
    <%
    while not blah.bof or blah.eof
    %>
    <Userkey><%=blah.fields("messagedata")%></Userkey>
    <Password><%=blah.fields("messagedata")%></Password>
    <Recipient>
    <%
    'make sub query if needed
    while not blah2.bof or blah2.eof
    %>
    <PhoneNumber></PhoneNumber>
    <%
     blah2.movenext
    wend
    %>
    </Recipient>
    <MessageData><%=blah.fields("messagedata")%></MessageData>
    <%
     blah.movenext
    wend
    %>
    <Action>SendTextSMS</Action>
    </aspsms>
    <%
    'clean up etc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •