issues with simplexml_load_string/SimpleXMLElement on PHP 5.1/Linux

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting issues with simplexml_load_string/SimpleXMLElement on PHP 5.1/Linux
# 1  
Old 09-10-2009
Question issues with simplexml_load_string/SimpleXMLElement on PHP 5.1/Linux

This works fine under WAMP with PHP 5.3 and Windows XP on my dev machine. But on a Unix/PHP 5.1 env it doesn't. I am looking to pull out "LineNumber" and "TaxAmount" from the XML for each iteration of the loop below, for each iteration "$tax_line" is always an object of simplexml_load_string ( ).

$tax_line is the following object, which obviously has a type of "object".

Does anyone know how I would do this?

The point where things seem to get screwy between Windows and Linux is when I come to this line: $tax_lines = $tax_document->TaxLines->TaxLine;

The SimpleXMLElement is a print_r dump of "$tax_line".

Any help would be really appreciated. Have been looking at this for ages now!


SimpleXMLElement Object
    [@attributes] => Array
            [Id] => 1
    [LineNumber] => 1
    [TaxSummary] => SimpleXMLElement Object
            [EffectTaxRate] => 0.09752
            [TaxAmount] => 24.38
            [TaxBasis] => 250.00

PHP Code:
$response_xml simplexml_load_string($data);    
$document_status $tax_document->DocumentStatus->Success// this can be outputted fine
$tax_lines $tax_document->TaxLines->TaxLine;                
foreach (
$tax_lines as $tax_line) {
$linenumber = (string) $tax_line[0]->LineNumber;            
$taxamount = (string) $tax_line[0]->TaxSummary->TaxAmount;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issues installing RubyGems on Linux

Hi, I am getting error installing rubygems as shown below: $ pwd /ticket/tools/binaries/rubygems-2.6.12 $ sudo ruby setup.rb password for redmine: <internal:gem_prelude>:4:in `require': cannot load such file -- rubygems.rb (LoadError) from <internal:gem_prelude>:4:in... (0 Replies)
Discussion started by: mohtashims
0 Replies

2. UNIX and Linux Applications

Xalan & Xerces issues for Oracle Linux 6.6 & Solarisstudio12.3 C++ compiler for Linux

Hi Team, I am facing issue while using Xalan & Xerces for my application. Below are my environment details i am using :- Platform:- Oracle Linux 6.6 Compiler :- solarisstudio12.3 C++ compiler for Linux Below are the versions of Xalan & Xerces source code used to build the shared object... (0 Replies)
Discussion started by: agrachirag
0 Replies

3. Red Hat

Linux Bind mount issues.

Hi All, we have an issue in bind mounting LINUX. we are able to see the bound mounts in mount command and df -h <file system name> but they are not visible in normal df -h command. all these mounts are local mounts. we have a /xyz is mount and abc is a directory in /xyz ( /xyz/abc ) ... (1 Reply)
Discussion started by: Naveen.6025
1 Replies

4. Red Hat

RedHat Linux GUI Issues

hi all i have installed Windows 7 first. then i installed linux on dual partations... i am booting both of them through dual boot... but when i start linux its only working well with CUI, when i used commands like startx or changed the initd to 5 then its loading the GUI interface of RedHat... (9 Replies)
Discussion started by: Nikhil Dethe
9 Replies

5. AIX

AIX 6.1 automount issues from Linux/Openfiler

Hello folks... have a problem here hopefully can find some direction with... we have a network using NIS authentication and automount for home dirs and other shared resources. Recently migrated some of our shares off of an EMC Celerra to an Openfiler solution. All of the clients in the NIS domain... (0 Replies)
Discussion started by: cruzshark
0 Replies

6. Shell Programming and Scripting

Issues in grep command in Linux

Hi All I have a file containing following records: $HEW_TGT_DB2_USER=hbme_bi2 $prmAttunityUser=ais $DS_USER=hbme_bi2 $prmStgUser=hbme_bi2 $prmuser=hbme_bi2 $prmStgPass=hbme_bi2 $prmpwd=hbme_bi2 $prmAttunityUser=ais Say suppose the name of the file is test4.txt When i fire this... (5 Replies)
Discussion started by: vee_789
5 Replies

7. Linux

Wireless issues in Linux Mint.

I am running Linux Mint Gloria on my PC. I have ADSL broadband connection which require login and pswd connection to connect. I have SmartAX MT841 modem which has wireless card free with it. I also have recently purchased DELL inspiron 1545 machine which have Vista preinstalled in it. Now I want to... (0 Replies)
Discussion started by: budtuxy
0 Replies

8. Shell Programming and Scripting

Solaris / Linux Issues with script

Hello, I run this command from a solaris box and it works just fine. It gives me the kind of output in my file I am looking for which would be for example... sb1p rdop ot2p ot3p eimp However when I do the same thing from a Linux box... ps -ef | grep nco_p_syslog | grep -v grep |... (19 Replies)
Discussion started by: LRoberts
19 Replies

9. Ubuntu

Linux Redhat ES 4.0 - DNS Config Issues

Hello all, I've a very strange thing hapenning in my Sys, I've configured the IP, DNS eveything for my internat connection, but Im only able to browse websites. I cant open anyother site!!! :eek: Im sure the internet is configured 'coz it displays the list of avail updates for... (11 Replies)
Discussion started by: AbhijithS
11 Replies

10. Programming

Bit field issues in Linux

edit: skip this post...the next is a better explaination of my issue. (2 Replies)
Discussion started by: DreamWarrior
2 Replies
Login or Register to Ask a Question