Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6063 > unrolled thread

Not understood error...

Started bytaltene@gmail.com
First post2012-05-13 07:24 -0700
Last post2012-05-15 19:36 +0200
Articles 2 — 2 participants

Back to article view | Back to comp.lang.php


Contents

  Not understood error... taltene@gmail.com - 2012-05-13 07:24 -0700
    Re: Not understood error... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-05-15 19:36 +0200

#6063 — Not understood error...

Fromtaltene@gmail.com
Date2012-05-13 07:24 -0700
SubjectNot understood error...
Message-ID<11713180.2077.1336919063202.JavaMail.geo-discussion-forums@vbq5>
Hi,

 I've got the following value in properties file.
 This is how I read it:

----------------------------------------------------------

Function ReadValueByKey ($PropFile, $PropKey) {

 $bCheckFlag = false;
	
 $Prop_Key = "_resp_".(strtolower($PropKey));
 $Prop_File = file($PropFile);

 unset($Prop_Value);

 for($Counter = 0; $Counter < sizeof($Prop_File) && ($bCheckFlag == false); $Counter++) {

  $Prop_Temp = trim($Prop_File[$Counter]); 

  $Prop_Tmp = strtolower($Prop_Temp);

  if (substr_count($Prop_Tmp, $Prop_Key . "=") > 0) {
     $Prop_Value = substr($Prop_Temp, strlen($Prop_Key . "="));
     while($Counter != sizeof($Prop_File))
     {
	$sLine = trim($Prop_File[$Counter++]); 
	$sLine = strtolower($sLine);
	if ($bCheckFlag == true) {
          if(substr_count($sLine, "_resp_") < 1){
	     if($sLine != ""){
		$Prop_Value = $Prop_Value."\n".$sLine;
	     }
	  }else
		break;
	}else{
	   $bCheckFlag = true;
	}
      }
    }
 } // end for
	
 //print("Prop_Value=".$Prop_Value."\n\n");
 print($Prop_Value);

 return $Prop_Value;
}
-------------------------------------------------------------

The key-value is read is as follows:

-------------------------------------------------------------

_resp_authSchema=<?xml version\="1.0" encoding\="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV\="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC\="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi\="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd\="http://www.w3.org/2001/XMLSchema" xmlns:al\="http://www.alcatel-lucent.com/soap_cm" xmlns:gd\="http://www.3gpp.org/ftp/Specs/archive/32_series/32317/schema/32317-700/GenericIRPData" xmlns:bs\="http://www.3gpp.org/ftp/Specs/archive/32_series/32607/schema/32607-700/BasicCMIRPSystem" xmlns:bd\="http://www.3gpp.org/ftp/Specs/archive/32_series/32607/schema/32607-700/BasicCMIRPData">
.<SOAP-ENV:Body>
..<bd:createMOResponse>
...<mO>
....<moiLocation>impiId\=+{__IMPIID},imsServiceProfileId\=1,suMSubscriptionProfileId\=1,suMSubscriberProfileId\=+{__MSUBSCRIBERPROFILEID}_at,subscriptionFunctionId\=1,managedElementId\=HSS1</moiLocation>
...</mO>
..</bd:createMOResponse>
.</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

------------------------------------------------------------------

Now the problem is as follows:

When use the first print out of the two at the bottom of the function I get:

-------------------------------------------------------------------


Prop_Value=<?xml version\=\"1.0\" encoding\=\"UTF-8\"?>
<soap-env:envelope xmlns:soap-env\=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soap-enc\=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi\=\"http://www.w3.org/2001/xmlschema-instance\" xmlns:xsd\=\"http://www.w3.org/2001/xmlschema\" xmlns:al\=\"http://www.alcatel-lucent.com/soap_cm\" xmlns:gd\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32317/schema/32317-700/genericirpdata\" xmlns:bs\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32607/schema/32607-700/basiccmirpsystem\" xmlns:bd\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32607/schema/32607-700/basiccmirpdata\">
.<soap-env:body>
..<bd:createmoresponse>
...<mo>
....<moilocation>impiid\=+{__impiid},imsserviceprofileid\=1,sumsubscriptionprofileid\=1,sumsubscriberprofileid\=+{__msubscriberprofileid}_at,subscriptionfunctionid\=1,managedelementid\=hss1</moilocation>
...</mo>
..</bd:createmoresponse>
.</soap-env:body>
</soap-env:envelope>
--------------------------------------------------------------

As required!

But, when I comment this print and uncomment the next one, I get the following error message:

----------------------------------------------------------------

This page contains the following errors:

error on line 1 at column 13: expected '='
Below is a rendering of the page up to the first error.

-----------------------------------------------------------------

And this is what I get when I "view source" this page:

-----------------------------------------------------------------


<?xml version\=\"1.0\" encoding\=\"UTF-8\"?>
<soap-env:envelope xmlns:soap-env\=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soap-enc\=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi\=\"http://www.w3.org/2001/xmlschema-instance\" xmlns:xsd\=\"http://www.w3.org/2001/xmlschema\" xmlns:al\=\"http://www.alcatel-lucent.com/soap_cm\" xmlns:gd\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32317/schema/32317-700/genericirpdata\" xmlns:bs\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32607/schema/32607-700/basiccmirpsystem\" xmlns:bd\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32607/schema/32607-700/basiccmirpdata\">
.<soap-env:body>
..<bd:createmoresponse>
...<mo>
....<moilocation>impiid\=+{__impiid},imsserviceprofileid\=1,sumsubscriptionprofileid\=1,sumsubscriberprofileid\=+{__msubscriberprofileid}_at,subscriptionfunctionid\=1,managedelementid\=hss1</moilocation>
...</mo>
..</bd:createmoresponse>
.</soap-env:body>
</soap-env:envelope>

--------------------------------------------------------------------

Any help will be blessed.
Thanks!

[toc] | [next] | [standalone]


#6070

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-05-15 19:36 +0200
Message-ID<2989638.dbgypaU67u@PointedEars.de>
In reply to#6063
taltene@gmail.com wrote:
^^^^^^^^^^^^^^^^^
Who?

> […]
> 
> This page contains the following errors:
> 
> error on line 1 at column 13: expected '='
> Below is a rendering of the page up to the first error.

That is _not_ a server-side PHP error message, it is a client-side error 
message printed by your browser (and its XML parser).
 
> -----------------------------------------------------------------
> 
> And this is what I get when I "view source" this page:
> 
> -----------------------------------------------------------------
> 
> 
> <?xml version\=\"1.0\" encoding\=\"UTF-8\"?>
> <soap-env:envelope
> xmlns:soap-env\=\"http://schemas.xmlsoap.org/soap/envelope/\"
> xmlns:soap-enc\=\"http://schemas.xmlsoap.org/soap/encoding/\"
> xmlns:xsi\=\"http://www.w3.org/2001/xmlschema-instance\"
> xmlns:xsd\=\"http://www.w3.org/2001/xmlschema\"
> xmlns:al\=\"http://www.alcatel-lucent.com/soap_cm\"
> 
xmlns:gd\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32317/schema/32317-700/genericirpdata\"
> 
xmlns:bs\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32607/schema/32607-700/basiccmirpsystem\"
> 
xmlns:bd\=\"http://www.3gpp.org/ftp/specs/archive/32_series/32607/schema/32607-700/basiccmirpdata\">
> .<soap-env:body> ..<bd:createmoresponse> ...<mo>
> 
....<moilocation>impiid\=+{__impiid},imsserviceprofileid\=1,sumsubscriptionprofileid\=1,sumsubscriberprofileid\=+{__msubscriberprofileid}_at,subscriptionfunctionid\=1,managedelementid\=hss1</moilocation>
> ...</mo> ..</bd:createmoresponse> .</soap-env:body> </soap-env:envelope>
> 
> --------------------------------------------------------------------

Apparently someone thought it would be a good idea to add backslashes in an 
XML document to "escape" equals and quotes, which it obviously is not.  The 
problems you are having and the parser error message that you are getting 
indicate (actuall, they show clearly) that the XML document to be processed 
(which can only be surmised as you failed to show the relationship) is not 
XML well-formed.  For example, the first line should be

<?xml version="1.0" encoding="UTF-8"?>

One you have fixed that, there should be less problems.  However, as you 
have not noticed that obvious error, you should reconsider doing any Web 
programming and starting to learn HTML (and, by extension, XML) first.

Then you should look into one of the several markup parsers that PHP 
provides so that you can eventually dump that inefficient, error-prone 
properties parser you have written (or included by copy-and-pray).

> Any help will be blessed.

I am _not_ calling you "God".

-- 
PointedEars

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web