Closed Thread
Results 1 to 5 of 5

Thread: Query on XML document

  1. #1
    amberlong83 is offline Newbie
    Join Date
    Jun 2009
    Posts
    4
    Rep Power
    0

    Query on XML document

    Hi friends

    I am working with PHP5 and have a requirement to select xml node on the base of parameter. My xml contains the list of country and it has child node of state list. Like this

    HTML Code:
    <?xml version="1.0" encoding="utf-8"?>
    <country_list>
    	<country id="US">
    		<state>NY</state>
    		<state>CA</state>
    		<state>NJ</state>		
    	</country>
    	<country id="AU">
    		<state>New South Wales</state>		
    		<state>Victoria</state>				
    		<state>Queensland</state>						
    	</country>	
    </country_list>
    I want to get the xml like

    HTML Code:
    <country id="AU">
    		<state>New South Wales</state>		
    		<state>Victoria</state>				
    		<state>Queensland</state>						
    	</country>
    Can anyone help me how can I achieve this?

    thanks in advance.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: Query on XML document

    Moved to the PHP Forum.

    You should use SimpleXML to read your XML document. It makes extracting values very easy.

  4. #3
    umapathyphp is offline Newbie
    Join Date
    Jul 2009
    Posts
    1
    Rep Power
    0

    Re: Query on XML document

    Hi jordan,

    Could u refer a sample code for this . I too in need of this

  5. #4
    Jordan Guest

    Re: Query on XML document

    Sure, the best place to go is the manual: PHP: SimpleXML - Manual

  6. #5
    amberlong83 is offline Newbie
    Join Date
    Jun 2009
    Posts
    4
    Rep Power
    0

    Re: Query on XML document

    thanks for reply

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 1 query vs multiple query
    By Vaielab in forum Database & Database Programming
    Replies: 1
    Last Post: 08-30-2011, 12:16 PM
  2. Document generation... how do I get around this
    By xsonline in forum PHP Development
    Replies: 2
    Last Post: 01-18-2011, 02:16 PM
  3. document.write()
    By VakhoQ in forum JavaScript and CSS
    Replies: 6
    Last Post: 01-08-2011, 10:37 PM
  4. How do I use xsl:choose in XSL document?
    By system32 in forum ASP, ASP.NET and Coldfusion
    Replies: 1
    Last Post: 09-25-2010, 11:54 AM
  5. How to convert an html document into am msword document?
    By greenerworld in forum HTML Programming
    Replies: 1
    Last Post: 11-23-2009, 03:25 AM

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