SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xml lower case nodes problem

    i am using webservice to get xml result by php

    PHP Code:
                $xml=simplexml_load_string($xml); 
    the problem is in the nodes , i got from webservice the nodes in this format ParentNode and other times in this format parentnode

    how i can make the nodes only in lower case?????

    without changing it's inner values to lower case...


    e.g:


    Before:

    Code:
    <ParentNode>
       <ChildItem TestAttribute="ValueCasing" >
    	This text Will not Be Harmed!
       </ChildItem>
    </ParentNode>
    After:

    Code:
    <parentnode>
       <childitem testattribute="valuecasing" >
    	This text Will not Be Harmed!
       </childitem>
    </parentnode>

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,629
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You should get the provider to properly implement the web service -- XML is case sensitive so ParentNode, parentNode and parentnode are three distinct tags.

    If you can't fix it you can probably handle it using old-school SAX parsers -- IIRC those are the xml functions in PHP. That has callbacks so you can handle case sensitivity in your callbacks and such.


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
  •