SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast bokz_42's Avatar
    Join Date
    Sep 2006
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    reading xml with other excess strings in the header

    hello, i have a page that displays an xml. when viewing the source code

    its like this-

    HTTP/1.1 200 OK
    Server: server/1.0
    Date: Tue, 09 Mar 2010 23:18:51 GMT
    Set-cookie: ctrust-session-v002b=AAAAAgABAEijGZ0nQ9Dyr0RI4xnTS4ip81Wyp62LaUoFGJTDL7h4dDBA0/yDFsygmQDEKJK7viEb3RkjTwvhO6kcWDGgaU2be45L2qDJ5Vg=; secure; domain=.domain.com; path=/
    Content-length: 804
    Content-type: text/html
    X-Powered-By: SOMETHING HERE
    Connection: close

    <?xml version="1.0" standalone="no"?>
    <ref>
    <id>
    <pkey>aaa</pkey>

    </id>
    <ref>


    My question is how can i retrieve the xml part? when i use a simple xml parser that i can get searching the net, it halts when it sees the header part thing. i've also tried strpos and search for the first occurence of <ref> and substr the values from the position of the <ref> but to no avail since the header part thing is always changing in terms of character size so the substr fails.


    hope you can understand my dilemma.

    thanks and more power!

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bokz_42 View Post
    i've also tried strpos and search for the first occurence of <ref> and substr the values from the position of the <ref> but to no avail since the header part thing is always changing in terms of character size so the substr fails.
    Have substr start at the position indicated by strpos.


Tags for this Thread

Bookmarks

Posting Permissions

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