iPhone weather forecast application - iphone

I am working with an iphone application in xcode that uses the google weather api. But when i connects to the api then its giving me the following output
2010-04-28 12:19:56.903 weather[176:20b] urlstring: http://www.google.com/ig/api?weather=Kolkata
2010-04-28 12:19:57.214 weather[176:20b] Receiving data... 2010-04-28 12:19:57.215 weather[176:20b] responsedata: <3c3f786d 6c207665 7273696f 6e3d2231 2e30223f 3e3c786d 6c5f6170 695f7265 706c7920 76657273 696f6e3d 2231223e 3c776561 74686572 206d6f64 756c655f 69643d22 30222074 61625f69 643d2230 22206d6f 62696c65 5f726f77 3d223022 206d6f62 696c655f 7a697070 65643d22 31222072 6f773d22 30222073 65637469 6f6e3d22 3022203e 3c666f72 65636173 745f696e 666f726d 6174696f 6e3e3c63 69747920 64617461 3d224b6f 6c6b6174 612c2057 65737420 42656e67 616c222f 3e3c706f 7374616c 5f636f64 65206461 74613d22 4b6f6c6b 61746122 2f3e3c6c 61746974 7564655f 65362064 6174613d 22222f3e 3c6c6f6e 67697475 64655f65 36206461 74613d22 222f3e3c 666f7265 63617374 5f646174 65206461 74613d22 32303130 2d30342d 3238222f 3e3c6375 7272656e 745f6461 74655f74 696d6520 64617461 3d223230 31302d30 342d3238 2030363a 32303a30 30202b30 30303022 2f3e3c75 6e69745f 73797374 656d2064 6174613d 22555322 2f3e3c2f 666f7265 63617374 5f696e66 6f726d61 74696f6e 3e3c6375 7272656e 745f636f 6e646974 696f6e73 3e3c636f 6e646974 696f6e20 64617461 3d224861 7a65222f 3e3c7465 6d705f66 20646174 613d2239 37222f3e 3c74656d 705f6320 64617461 3d223336 222f3e3c 68756d69 64697479 20646174 613d2248 756d6964 6974793a 20363025 222f3e3c 69636f6e 20646174 613d222f 69672f69 6d616765 732f7765 61746865 722f6861 7a652e67 6966222f 3e3c7769 6e645f63 6f6e6469 74696f6e 20646174 613d2257 696e643a 20532061 74203133 206d7068 222f3e3c 2f637572 72656e74 5f636f6e 64697469 6f6e733e 3c666f72 65636173 745f636f 6e646974 696f6e73 3e3c6461 795f6f66 5f776565 6b206461 74613d22 57656422 2f3e3c6c 6f772064 6174613d 22383222 2f3e3c68 69676820 64617461 3d223931 222f3e3c 69636f6e 20646174 613d222f 69672f69 6d616765 732f7765 61746865 722f6368 616e6365 5f6f665f 7261696e 2e676966 222f3e3c 636f6e64 6974696f 6e206461 74613d22 4368616e 6365206f 66205261 696e222f 3e3c2f66 6f726563 6173745f 636f6e64 6974696f 6e733e3c 666f7265 63617374 5f636f6e 64697469 6f6e733e 3c646179 5f6f665f 7765656b 20646174 613d2254 6875222f 3e3c6c6f 77206461 74613d22 3832222f 3e3c6869 67682064 6174613d 22393622 2f3e3c69 636f6e20 64617461 3d222f69 672f696d 61676573 2f776561 74686572 2f726169 6e2e6769 66222f3e 3c636f6e 64697469 6f6e2064 6174613d 22526169 6e222f3e 3c2f666f 72656361 73745f63 6f6e6469 74696f6e 733e3c66 6f726563 6173745f 636f6e64 6974696f 6e733e3c 6461795f 6f665f77 65656b20 64617461 3d224672 69222f3e 3c6c6f77 20646174 613d2238 32222f3e 3c686967 68206461 74613d22 3936222f 3e3c6963 6f6e2064 6174613d 222f6967 2f696d61 6765732f 77656174 6865722f 73756e6e 792e6769 66222f3e 3c636f6e 64697469 6f6e2064 6174613d 22436c65 6172222f 3e3c2f66 6f726563> 2010-04-28 12:19:57.217 weather[176:20b] Receiving data... 2010-04-28 12:19:57.217 weather[176:20b] responsedata: <3c3f786d 6c207665 7273696f 6e3d2231 2e30223f 3e3c786d 6c5f6170 695f7265 706c7920 76657273 696f6e3d 2231223e 3c776561 74686572 206d6f64 756c655f 69643d22 30222074 61625f69 643d2230 22206d6f 62696c65 5f726f77 3d223022 206d6f62 696c655f 7a697070 65643d22 31222072 6f773d22 30222073 65637469 6f6e3d22 3022203e 3c666f72 65636173 745f696e 666f726d 6174696f 6e3e3c63 69747920 64617461 3d224b6f 6c6b6174 612c2057 65737420 42656e67 616c222f 3e3c706f 7374616c 5f636f64 65206461 74613d22 4b6f6c6b 61746122 2f3e3c6c 61746974 7564655f 65362064 6174613d 22222f3e 3c6c6f6e 67697475 64655f65 36206461 74613d22 222f3e3c 666f7265 63617374 5f646174 65206461 74613d22 32303130 2d30342d 3238222f 3e3c6375 7272656e 745f6461 74655f74 696d6520 64617461 3d223230 31302d30 342d3238 2030363a 32303a30 30202b30 30303022 2f3e3c75 6e69745f 73797374 656d2064 6174613d 22555322 2f3e3c2f 666f7265 63617374 5f696e66 6f726d61 74696f6e 3e3c6375 7272656e 745f636f 6e646974 696f6e73 3e3c636f 6e646974 696f6e20 64617461 3d224861 7a65222f 3e3c7465 6d705f66 20646174 613d2239 37222f3e 3c74656d 705f6320 64617461 3d223336 222f3e3c 68756d69 64697479 20646174 613d2248 756d6964 6974793a 20363025 222f3e3c 69636f6e 20646174 613d222f 69672f69 6d616765 732f7765 61746865 722f6861 7a652e67 6966222f 3e3c7769 6e645f63 6f6e6469 74696f6e 20646174 613d2257 696e643a 20532061 74203133 206d7068 222f3e3c 2f637572 72656e74 5f636f6e 64697469 6f6e733e 3c666f72 65636173 745f636f 6e646974 696f6e73 3e3c6461 795f6f66 5f776565 6b206461 74613d22 57656422 2f3e3c6c 6f772064 6174613d 22383222 2f3e3c68 69676820 64617461 3d223931 222f3e3c 69636f6e 20646174 613d222f 69672f69 6d616765 732f7765 61746865 722f6368 616e6365 5f6f665f 7261696e 2e676966 222f3e3c 636f6e64 6974696f 6e206461 74613d22 4368616e 6365206f 66205261 696e222f 3e3c2f66 6f726563 6173745f 636f6e64 6974696f 6e733e3c 666f7265 63617374 5f636f6e 64697469 6f6e733e 3c646179 5f6f665f 7765656b 20646174 613d2254 6875222f 3e3c6c6f 77206461 74613d22 3832222f 3e3c6869 67682064 6174613d 22393622 2f3e3c69 636f6e20 64617461 3d222f69 672f696d 61676573 2f776561 74686572 2f726169 6e2e6769 66222f3e 3c636f6e 64697469 6f6e2064 6174613d 22526169 6e222f3e 3c2f666f 72656361 73745f63 6f6e6469 74696f6e 733e3c66 6f726563 6173745f 636f6e64 6974696f 6e733e3c 6461795f 6f665f77 65656b20 64617461 3d224672 69222f3e 3c6c6f77 20646174 613d2238 32222f3e 3c686967 68206461 74613d22 3936222f 3e3c6963 6f6e2064 6174613d 222f6967 2f696d61 6765732f 77656174 6865722f 73756e6e 792e6769 66222f3e 3c636f6e 64697469 6f6e2064 6174613d 22436c65 6172222f 3e3c2f66 6f726563 6173745f 636f6e64 6974696f 6e733e3c 666f7265 63617374 5f636f6e 64697469 6f6e733e 3c646179 5f6f665f 7765656b 20646174 613d2253 6174222f 3e3c6c6f 77206461 74613d22 3738222f 3e3c6869 67682064 6174613d 22393822 2f3e3c69 636f6e20 64617461 3d222f69 672f696d 61676573 2f776561 74686572 2f6d6f73 746c795f 73756e6e 792e6769 66222f3e 3c636f6e 64697469 6f6e2064 6174613d 224d6f73 746c7920 53756e6e 79222f3e 3c2f666f 72656361 73745f63 6f6e6469 74696f6e 733e3c2f 77656174 6865723e 3c2f786d 6c5f6170 695f7265 706c793e> 2010-04-28 12:19:57.219 weather[176:20b] Finished loading...
My Code looks like this
- (void)viewDidLoad
{
NSString *currentLocation=#"Kolkata";
NSString *URLString = [NSString stringWithFormat:#"http://www.google.com/ig/api?weather=%#", currentLocation];
NSLog(#"urlstring: %#", URLString);
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:URLString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (theConnection)
{
responseData = [[NSMutableData alloc] retain];
}
[super viewDidLoad];
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
[responseData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
NSLog(#"Receiving data...");
[responseData appendData:data];
NSLog(#"responsedata: %#",responseData);
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
NSLog(#"Reverse Geocode request to Google failed!");
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(#"Finished loading...");
[connection release];
}
I can't figure it out how to read this data.
Looking for your's valuable suggetion. I am using this url(http://www.google.com/ig/api?weather=kolkata)
Thanks in advance

I suspect that this is because you are using NSData. Try converting that to NSString or just use an NSString returning method like stringWithContentsOfURL:encoding:error:

Related

Soap request signing

Hello fellow developers,
I have no experience working on soap, saml and xml signing,
I am trying to generate this structure and then add 2 signature tags to it.
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header xmlns:a="http://www.w3.org/2005/08/addressing">
<a:MessageID></a:MessageID>
<a:To env:mustUnderstand="true"></a:To>
<a:Action env:mustUnderstand="true">urn:hl7-org:v3:PRPA_IN201305UV02:CrossGatewayPatientDiscovery</a:Action>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Timestamp wsu:Id="timestamp_ID">
<wsu:Created>2022-10-13T18:18:17.763Z</wsu:Created>
<wsu:Expires>2023-10-13T18:23:17.763Z</wsu:Expires>
</wsu:Timestamp>
<saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ID="assertion_ID" IssueInstant="2022-10-13T18:18:17.763Z" Version="2.0">
<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:X509SubjectName"></saml2:Issuer>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#assertion_ID">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue></DigestValue>
</Reference>
</SignedInfo>
<SignatureValue></SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate></X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
<saml2:Subject>
<saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName"></saml2:NameID>
<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:holder-of-key">
<saml2:SubjectConfirmationData>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyValue>
<RSAKeyValue>
<Modulus></Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
</saml2:SubjectConfirmationData>
</saml2:SubjectConfirmation>
</saml2:Subject>
<saml2:Conditions NotBefore="2022-10-13T18:15:17.763Z" NotOnOrAfter="2022-10-13T18:23:17.763Z">
<saml2:AudienceRestriction>
<saml2:Audience></saml2:Audience>
</saml2:AudienceRestriction>
</saml2:Conditions>
<saml2:AuthnStatement AuthnInstant="2022-10-13T17:55:17.743Z" SessionIndex="1234567890">
<saml2:SubjectLocality Address="10.1.1.144" DNSName="localhost"/>
<saml2:AuthnContext>
<saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef>
</saml2:AuthnContext>
</saml2:AuthnStatement>
<saml2:AttributeStatement>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:subject-id">
<saml2:AttributeValue>John Doe</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization">
<saml2:AttributeValue>Dr. John M Doe, MD Practice</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization-id">
<saml2:AttributeValue></saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:nhin:names:saml:homeCommunityId">
<saml2:AttributeValue></saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xacml:2.0:subject:role">
<saml2:AttributeValue>
<Role xmlns="urn:hl7-org:v3" code="112247003" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Medical doctor" xsi:type="CE"/>
</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:purposeofuse">
<saml2:AttributeValue>
<PurposeOfUse xmlns="urn:hl7-org:v3" code="TREATMENT" codeSystem="2.16.840.1.113883.3.18.7.1" codeSystemName="nhin-purpose" displayName="Treatment" xsi:type="CE"/>
</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xacml:2.0:resource:resource-id">
<saml2:AttributeValue></saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
</saml2:Assertion>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#timestamp_ID">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue></DigestValue>
</Reference>
</SignedInfo>
<SignatureValue></SignatureValue>
<KeyInfo>
<wsse:SecurityTokenReference xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0">
<wsse:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLID">assertion_ID</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</KeyInfo>
</Signature>
</wsse:Security>
</env:Header>
<env:Body>
<PRPA_IN201305UV02 xmlns="urn:hl7-org:v3" ITSVersion="XML_1.0">
<id extension="126627497759" root="1.3.6.1.4.1.52618.1.3"/>
<creationTime value="20221013181817"/>
<interactionId extension="PRPA_IN201305UV02" root="2.16.840.1.113883.1.6"/>
<processingCode code="P"/>
<processingModeCode code="T"/>
<acceptAckCode code="AL"/>
<receiver typeCode="RCV">
<device classCode="DEV" determinerCode="INSTANCE">
<id root="0.0.0"/>
<telecom value="https://RH-Windows-TMP-b994dba9f85ba908.elb.us-east-1.amazonaws.com:4437/"/>
<asAgent classCode="AGNT">
<representedOrganization classCode="ORG" determinerCode="INSTANCE">
<id root=""/>
</representedOrganization>
</asAgent>
</device>
</receiver>
<sender typeCode="SND">
<device classCode="DEV" determinerCode="INSTANCE">
<id root="1.3.6.1.4.1.52618.1.2"/>
<asAgent classCode="AGNT">
<representedOrganization classCode="ORG" determinerCode="INSTANCE">
<id root="1.3.6.1.4.1.52618.1"/>
</representedOrganization>
</asAgent>
</device>
</sender>
<controlActProcess classCode="CACT" moodCode="EVN">
<code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/>
<authorOrPerformer typeCode="AUT">
<assignedDevice classCode="ASSIGNED">
<id root="1.3.6.1.4.1.52618.1.1"/>
</assignedDevice>
</authorOrPerformer>
<queryByParameter>
<queryId extension="126627497760" root="1.3.6.1.4.1.52618.1.3.1"/>
<statusCode code="new"/>
<responseModalityCode code="R"/>
<responsePriorityCode code="I"/>
<parameterList>
<livingSubjectAdministrativeGender>
<value code="M"/>
<semanticsText>LivingSubject.administrativeGender</semanticsText>
</livingSubjectAdministrativeGender>
<livingSubjectBirthTime>
<value value=""/>
<semanticsText>LivingSubject.birthTime</semanticsText>
</livingSubjectBirthTime>
<livingSubjectId>
<value extension="" root="1.3.6.1.4.1.52618.1.1"/>
<semanticsText>LivingSubject.id</semanticsText>
</livingSubjectId>
<livingSubjectName>
<value>
<given></given>
<family>TEST</family>
</value>
<semanticsText>LivingSubject.name</semanticsText>
</livingSubjectName>
<patientAddress>
<value>
<streetAddressLine>Home Dr</streetAddressLine>
<city>Charlotte</city>
<state>NC</state>
<postalCode></postalCode>
<country>US</country>
</value>
<semanticsText>Patient.addr</semanticsText>
</patientAddress>
</parameterList>
</queryByParameter>
</controlActProcess>
</PRPA_IN201305UV02>
</env:Body>
</env:Envelope>
I am using rhino javascript and below is the code
//////////////////////////////////////////////////////////////////////////////////
// Generate our dynamic message values
//
var timestampId = UUIDGenerator.getUUID();
var assertionId = UUIDGenerator.getUUID();
var createdTimestamp = new Date().toISOString();
var expiresTimestamp = new Date((new Date()).getTime() + 10000*10).toISOString();
var samlenvelope="<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\">"+
"<env:Header xmlns:a=\"http://www.w3.org/2005/08/addressing\">"+
"<a:MessageID>urn:uuid:32886a29-98ad-4284-b00e-3fe4ded10d16</a:MessageID>"+
"<a:To env:mustUnderstand=\"true\"></a:To>"+
"<a:Action env:mustUnderstand=\"true\">urn:hl7-org:v3:PRPA_IN201305UV02:CrossGatewayPatientDiscovery</a:Action>"+
"<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">"+
"<wsu:Timestamp wsu:Id=\"timestamp_ID\">"+
"<wsu:Created>2022-10-13T18:18:17.763Z</wsu:Created>"+
"<wsu:Expires>2023-10-13T18:23:17.763Z</wsu:Expires>"+
"</wsu:Timestamp>"+
"<saml2:Assertion xmlns:saml2=\"urn:oasis:names:tc:SAML:2.0:assertion\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ID=\"assertion_ID\" IssueInstant=\"2022-10-13T18:18:17.763Z\" Version=\"2.0\">"+
"<saml2:Issuer Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:X509SubjectName\"></saml2:Issuer>"+
"<saml2:Subject>"+
"<saml2:NameID Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName\"></saml2:NameID>"+
"<saml2:SubjectConfirmation Method=\"urn:oasis:names:tc:SAML:2.0:cm:holder-of-key\">"+
"<saml2:SubjectConfirmationData>"+
"<KeyInfo xmlns=\"http://www.w3.org/2000/09/xmldsig#\">"+
"<KeyValue>"+
"<RSAKeyValue>"+
"<Modulus></Modulus>"+
"<Exponent>AQAB</Exponent>"+
"</RSAKeyValue>"+
"</KeyValue>"+
"</KeyInfo>"+
"</saml2:SubjectConfirmationData>"+
"</saml2:SubjectConfirmation>"+
"</saml2:Subject>"+
"<saml2:Conditions NotBefore=\"2022-10-13T18:15:17.763Z\" NotOnOrAfter=\"2022-10-13T18:23:17.763Z\">"+
"</saml2:Conditions>"+
"<saml2:AuthnStatement AuthnInstant=\"2022-10-13T17:55:17.743Z\" SessionIndex=\"1234567890\">"+
"<saml2:SubjectLocality Address=\"10.1.1.144\" DNSName=\"localhost\"/>"+
"<saml2:AuthnContext>"+
"<saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef>"+
"</saml2:AuthnContext>"+
"</saml2:AuthnStatement>"+
"<saml2:AttributeStatement>"+
"<saml2:Attribute Name=\"urn:oasis:names:tc:xspa:1.0:subject:subject-id\">"+
"<saml2:AttributeValue>John Doe</saml2:AttributeValue>"+
"</saml2:Attribute>"+
"<saml2:Attribute Name=\"urn:oasis:names:tc:xspa:1.0:subject:organization\">"+
"<saml2:AttributeValue>Dr. John M Doe, MD Practice</saml2:AttributeValue>"+
"</saml2:Attribute>"+
"<saml2:Attribute Name=\"urn:oasis:names:tc:xspa:1.0:subject:organization-id\">"+
"<saml2:AttributeValue></saml2:AttributeValue>"+
"</saml2:Attribute>"+
"<saml2:Attribute Name=\"urn:nhin:names:saml:homeCommunityId\">"+
"<saml2:AttributeValue></saml2:AttributeValue>"+
"</saml2:Attribute>"+
"<saml2:Attribute Name=\"urn:oasis:names:tc:xacml:2.0:subject:role\">"+
"<saml2:AttributeValue>"+
"<Role xmlns=\"urn:hl7-org:v3\" code=\"112247003\" codeSystem=\"2.16.840.1.113883.6.96\" codeSystemName=\"SNOMED CT\" displayName=\"Medical doctor\" xsi:type=\"CE\"/>"+
"</saml2:AttributeValue>"+
"</saml2:Attribute>"+
"<saml2:Attribute Name=\"urn:oasis:names:tc:xspa:1.0:subject:purposeofuse\">"+
"<saml2:AttributeValue>"+
"<PurposeOfUse xmlns=\"urn:hl7-org:v3\" code=\"TREATMENT\" codeSystem=\"2.16.840.1.113883.3.18.7.1\" codeSystemName=\"nhin-purpose\" displayName=\"Treatment\" xsi:type=\"CE\"/>"+
"</saml2:AttributeValue>"+
"</saml2:Attribute>"+
"<saml2:Attribute Name=\"urn:oasis:names:tc:xacml:2.0:resource:resource-id\">"+
"<saml2:AttributeValue></saml2:AttributeValue>"+
"</saml2:Attribute>"+
"</saml2:AttributeStatement>"+
"</saml2:Assertion>"+
"</wsse:Security>"+
"</env:Header>"+
"<env:Body>"+
"<PRPA_IN201305UV02 xmlns=\"urn:hl7-org:v3\" ITSVersion=\"XML_1.0\">"+
"<id extension=\"126627497759\" root=\"1.3.6.1.4.1.52618.1.3\"/>"+
"<creationTime value=\"20221013181817\"/>"+
"<interactionId extension=\"PRPA_IN201305UV02\" root=\"2.16.840.1.113883.1.6\"/>"+
"<processingCode code=\"P\"/>"+
"<processingModeCode code=\"T\"/>"+
"<acceptAckCode code=\"AL\"/>"+
"<receiver typeCode=\"RCV\">"+
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">"+
"<id root=\"0.0.0\"/>"+
"<telecom value=\"https://RH-Windows-TMP-b994dba9f85ba908.elb.us-east-1.amazonaws.com:4437/\"/>"+
"<asAgent classCode=\"AGNT\">"+
"<representedOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\">"+
"<id root=\"\"/>"+
"</representedOrganization>"+
"</asAgent>"+
"</device>"+
"</receiver>"+
"<sender typeCode=\"SND\">"+
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">"+
"<id root=\"1.3.6.1.4.1.52618.1.2\"/>"+
"<asAgent classCode=\"AGNT\">"+
"<representedOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\">"+
"<id root=\"1.3.6.1.4.1.52618.1\"/>"+
"</representedOrganization>"+
"</asAgent>"+
"</device>"+
"</sender>"+
"<controlActProcess classCode=\"CACT\" moodCode=\"EVN\">"+
"<code code=\"PRPA_TE201305UV02\" codeSystem=\"2.16.840.1.113883.1.6\"/>"+
"<authorOrPerformer typeCode=\"AUT\">"+
"<assignedDevice classCode=\"ASSIGNED\">"+
"<id root=\"1.3.6.1.4.1.52618.1.1\"/>"+
"</assignedDevice>"+
"</authorOrPerformer>"+
"<queryByParameter>"+
"<queryId extension=\"\" root=\"1.3.6.1.4.1.52618.1.3.1\"/>"+
"<statusCode code=\"new\"/>"+
"<responseModalityCode code=\"R\"/>"+
"<responsePriorityCode code=\"I\"/>"+
"<parameterList>"+
"<livingSubjectAdministrativeGender>"+
"<value code=\"M\"/>"+
"<semanticsText>LivingSubject.administrativeGender</semanticsText>"+
"</livingSubjectAdministrativeGender>"+
"<livingSubjectBirthTime>"+
"<value value=\"\"/>"+
"<semanticsText>LivingSubject.birthTime</semanticsText>"+
"</livingSubjectBirthTime>"+
"<livingSubjectId>"+
"<value extension=\"\" root=\"1.3.6.1.4.1.52618.1.1\"/>"+
"<semanticsText>LivingSubject.id</semanticsText>"+
"</livingSubjectId>"+
"<livingSubjectName>"+
"<value>"+
"<given></given>"+
"<family>TEST</family>"+
"</value>"+
"<semanticsText>LivingSubject.name</semanticsText>"+
"</livingSubjectName>"+
"<patientAddress>"+
"<value>"+
"<streetAddressLine>Home Dr</streetAddressLine>"+
"<city>Charlotte</city>"+
"<state>NC</state>"+
"<postalCode></postalCode>"+
"<country>US</country>"+
"</value>"+
"<semanticsText>Patient.addr</semanticsText>"+
"</patientAddress>"+
"</parameterList>"+
"</queryByParameter>"+
"</controlActProcess>"+
"</PRPA_IN201305UV02>"+
"</env:Body>"+
"</env:Envelope>"+;
var samlString = new java.lang.String(samlenvelope);
////////////////////////////////////////////////////////////////////////////////////
// Build our XML DOM for signature
//
var documentBuilderFactory = javax.xml.parsers.DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
var document = documentBuilderFactory.newDocumentBuilder().parse(new java.io.ByteArrayInputStream(samlString.getBytes("utf-8")));
////////////////////////////////////////////////////////////////////////////////////
// Configure Digital Signature utilities for required crypto operations
//
var xmlDsigFactory = javax.xml.crypto.dsig.XMLSignatureFactory.getInstance("DOM");
var parameterSpec = new javax.xml.crypto.dsig.spec.ExcC14NParameterSpec();
var reference = xmlDsigFactory.newReference
(
"#assertion_ID",
xmlDsigFactory.newDigestMethod(javax.xml.crypto.dsig.DigestMethod.SHA1, null),
java.util.Collections.singletonList(xmlDsigFactory.newTransform("http://www.w3.org/2001/10/xml-exc-c14n#", parameterSpec)),
null, //type
null //id
)
var signedInfo = xmlDsigFactory.newSignedInfo
(
xmlDsigFactory.newCanonicalizationMethod
(
javax.xml.crypto.dsig.CanonicalizationMethod.EXCLUSIVE,
parameterSpec
),
xmlDsigFactory.newSignatureMethod(javax.xml.crypto.dsig.SignatureMethod.RSA_SHA1, null),
java.util.Collections.singletonList(reference)
)
var reference1 = xmlDsigFactory.newReference
(
"#timestamp_ID",
xmlDsigFactory.newDigestMethod(javax.xml.crypto.dsig.DigestMethod.SHA1, null),
java.util.Collections.singletonList(xmlDsigFactory.newTransform("http://www.w3.org/2001/10/xml-exc-c14n#", parameterSpec)),
null, //type
null //id
)
var signedInfo1 = xmlDsigFactory.newSignedInfo
(
xmlDsigFactory.newCanonicalizationMethod
(
javax.xml.crypto.dsig.CanonicalizationMethod.EXCLUSIVE,
parameterSpec
),
xmlDsigFactory.newSignatureMethod(javax.xml.crypto.dsig.SignatureMethod.RSA_SHA1, null),
java.util.Collections.singletonList(reference1)
)
//////////////////////////////////////////////////////
// Fetch our certificate and key
//
var certificate;
try
{
var inputStream = new java.io.FileInputStream("test.crt");
var certificateFactory = java.security.cert.CertificateFactory.getInstance("X.509");
certificate = certificateFactory.generateCertificate(inputStream);
}
finally
{
if (inputStream != null)
inputStream.close();
}
var privateKey;
var keyFactory = java.security.KeyFactory.getInstance("RSA");
var keySpec = new java.security.spec.PKCS8EncodedKeySpec(java.nio.file.Files.readAllBytes(new java.io.File("private_key.der").toPath()));
privateKey = keyFactory.generatePrivate(keySpec);
////////////////////////////////////////////////////////
// Generate the KeyInfo for our signature
//
var keyInfoFactory = xmlDsigFactory.getKeyInfoFactory();
var x509Content = new java.util.ArrayList();
x509Content.add(certificate);
var x509Data = keyInfoFactory.newX509Data(x509Content);
var keyInfo = keyInfoFactory.newKeyInfo(java.util.Collections.singletonList(x509Data));
var signature = xmlDsigFactory.newXMLSignature(signedInfo, keyInfo);
var dsc = new javax.xml.crypto.dsig.dom.DOMSignContext(privateKey, document.getDocumentElement());
var rootEl = document.getDocumentElement();
rootEl.setIdAttribute("ID",true);
signature.sign(dsc);
var signature1 = xmlDsigFactory.newXMLSignature(signedInfo1, keyInfo1);
var dsc = new javax.xml.crypto.dsig.dom.DOMSignContext(privateKey, document.getDocumentElement());
signature1.sign(dsc);
/*
var newEle=document.createElement("Transform");
newEle.setAttribute('Algorithm', 'http://www.w3.org/2000/09/xmldsig#enveloped-signature');
document.getElementsByTagName("Transforms").item(0).appendChild(newEle);*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Define any formatting preferences get the signed document as a string
//
var transformerFactory = javax.xml.transform.TransformerFactory.newInstance();
var transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
var stringWriter = new java.io.StringWriter();
transformer.transform(new javax.xml.transform.dom.DOMSource(document), new javax.xml.transform.stream.StreamResult(stringWriter));
channelMap.put("soapMessage", stringWriter.toString());
when I run the code I get this error
Wrapped org.w3c.dom.DOMException: NOT_FOUND_ERR: An attempt is made to
reference a node in a context where it does not exist.
Will appreciate your help

Flutter SVG gradient is not rendered: Failed to find definition for url

I have this gradient image
but it seems that flutter_svg is not able to render it.
The code of the image is:
<svg width="249" height="76" viewBox="0 0 249 76" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M156.656 57.6692C153.048 57.6692 149.734 56.8297 146.714 55.1506C143.693 53.4715 141.26 51.1628 139.415 48.2244C137.653 45.202 136.772 41.8019 136.772 38.0239C136.772 34.162 137.653 30.8038 139.415 27.9494C141.26 25.011 143.693 22.7442 146.714 21.1491C149.734 19.47 153.048 18.6304 156.656 18.6304C160.347 18.6304 163.661 19.47 166.597 21.1491C169.618 22.7442 172.009 25.011 173.771 27.9494C175.533 30.8038 176.413 34.162 176.413 38.0239C176.413 41.8019 175.533 45.202 173.771 48.2244C172.009 51.1628 169.618 53.4715 166.597 55.1506C163.661 56.8297 160.347 57.6692 156.656 57.6692ZM156.656 47.4688C159.256 47.4688 161.354 46.5873 162.948 44.8242C164.626 42.9772 165.465 40.7104 165.465 38.0239C165.465 35.2534 164.626 33.0286 162.948 31.3495C161.354 29.6704 159.256 28.8309 156.656 28.8309C154.139 28.8309 151.999 29.6704 150.237 31.3495C148.559 33.0286 147.721 35.2534 147.721 38.0239C147.721 40.7104 148.559 42.9772 150.237 44.8242C151.999 46.5873 154.139 47.4688 156.656 47.4688Z" fill="url(#paint0_linear_809_1834)"/>
<path d="M192.916 57.6692C187.211 57.6692 182.513 56.4939 178.822 54.1432C178.067 53.6394 177.521 53.0517 177.186 52.3801C176.85 51.6245 176.682 50.9109 176.682 50.2393C176.682 48.812 177.144 47.5108 178.067 46.3354C179.073 45.16 180.29 44.5723 181.716 44.5723C182.387 44.5723 183.058 44.7403 183.73 45.0761C185.24 45.7477 186.96 46.3354 188.889 46.8391C190.819 47.2589 192.581 47.4688 194.175 47.4688C197.279 47.4688 198.831 46.7552 198.831 45.3279C198.831 44.4884 198.454 43.7748 197.699 43.1871C196.943 42.5155 195.182 42.0537 192.413 41.8019C191.322 41.7179 189.896 41.55 188.134 41.2981C186.456 41.0463 184.778 40.5845 183.1 39.9129C181.422 39.1573 179.996 38.0659 178.822 36.6387C177.731 35.2114 177.186 33.2805 177.186 30.8458C177.186 27.0679 178.612 24.0875 181.464 21.9047C184.317 19.7218 188.134 18.6304 192.916 18.6304C195.685 18.6304 198.286 18.9243 200.719 19.512C203.236 20.0996 205.123 20.9812 206.382 22.1565C207.556 23.2479 208.144 24.5072 208.144 25.9345C208.144 27.1938 207.682 28.3272 206.759 29.3346C205.837 30.3421 204.662 30.8458 203.236 30.8458C202.481 30.8458 201.768 30.6779 201.096 30.3421C200.09 29.6704 198.789 29.1667 197.195 28.8309C195.685 28.4951 194.133 28.3272 192.539 28.3272C189.351 28.3272 187.757 28.9988 187.757 30.3421C187.757 30.9298 188.05 31.4755 188.638 31.9792C189.309 32.399 190.777 32.7768 193.042 33.1126C194.468 33.2805 196.104 33.5323 197.95 33.8682C199.796 34.12 201.558 34.6237 203.236 35.3793C204.998 36.051 206.466 37.1844 207.64 38.7795C208.815 40.3746 209.402 42.5574 209.402 45.3279C209.402 49.1059 207.892 52.1282 204.872 54.395C201.851 56.5778 197.866 57.6692 192.916 57.6692Z" fill="url(#paint1_linear_809_1834)"/>
<path d="M208.358 23.6677C208.358 21.9886 208.946 20.7293 210.12 19.8897C211.295 19.0502 212.637 18.6304 214.147 18.6304C215.322 18.6304 216.329 18.9662 217.168 19.6379C218.091 20.2256 218.72 21.0651 219.055 22.1565L226.858 41.1722C227.277 42.2636 227.865 42.8093 228.62 42.8093C229.375 42.8093 229.92 42.2636 230.256 41.1722L237.051 22.1565C237.471 20.9812 238.142 20.0996 239.065 19.512C240.072 18.9243 241.12 18.6304 242.211 18.6304C243.637 18.6304 244.938 19.0922 246.112 20.0157C247.371 20.9392 248 22.1565 248 23.6677C248 24.5072 247.832 25.3048 247.497 26.0604L227.865 71.3958C227.277 72.6551 226.522 73.5366 225.599 74.0404C224.76 74.628 223.879 74.9219 222.957 74.9219C221.446 74.9219 220.062 74.3762 218.804 73.2848C217.629 72.2773 217.042 71.06 217.042 69.6327C217.042 68.8772 217.21 68.2055 217.545 67.6178L224.341 55.5284C222.915 55.1086 221.782 54.0592 220.943 52.3801L208.736 25.9345C208.484 25.1789 208.358 24.4233 208.358 23.6677Z" fill="url(#paint2_linear_809_1834)"/>
<path d="M45.0462 53.0098C43.4521 54.2691 41.0191 55.3605 37.7471 56.284C34.4751 57.2075 31.287 57.6692 28.1828 57.6692C22.9811 57.6692 18.3248 56.5359 14.2139 54.2691C10.1029 51.9184 6.87283 48.6861 4.5237 44.5723C2.17457 40.4586 1 35.7991 1 30.5939C1 25.1369 2.13262 20.4355 4.39785 16.4896C6.74698 12.5437 9.97703 9.52137 14.088 7.42251C18.199 5.2397 22.9811 4.14829 28.4345 4.14829C30.6997 4.14829 32.965 4.35818 35.2302 4.77795C37.5793 5.19772 39.7187 5.86936 41.6483 6.79286C42.6551 7.29658 43.3682 7.96822 43.7877 8.80776C44.2911 9.56335 44.5428 10.4029 44.5428 11.3264C44.5428 12.6697 44.0394 13.929 43.0327 15.1043C42.1098 16.1958 40.8513 16.7415 39.2573 16.7415C38.5861 16.7415 37.873 16.6155 37.1179 16.3637C35.6077 15.776 33.9717 15.3142 32.2099 14.9784C30.448 14.5586 28.8959 14.3488 27.5536 14.3488C23.1909 14.3488 19.5414 15.818 16.6049 18.7564C13.7524 21.6948 12.3262 25.6406 12.3262 30.5939C12.3262 35.8831 13.7944 40.0388 16.7308 43.0612C19.7511 46.0835 23.6104 47.5947 28.3086 47.5947C30.2383 47.5947 32.2938 47.2589 34.4751 46.5873C36.6564 45.9156 38.4183 45.0761 39.7607 44.0686C40.6835 43.4809 41.6903 43.1871 42.781 43.1871C44.2072 43.1871 45.3398 43.6908 46.1788 44.6983C47.1017 45.6218 47.5631 46.7971 47.5631 48.2244C47.5631 50.0714 46.7241 51.6665 45.0462 53.0098Z" fill="url(#paint3_linear_809_1834)"/>
<path d="M56.587 57.6692C54.993 57.6692 53.6506 57.2075 52.5599 56.284C51.4693 55.3605 50.9239 54.1851 50.9239 52.7579V5.91133C50.9239 4.56806 51.4273 3.43468 52.4341 2.51118C53.5248 1.50373 54.9091 1 56.587 1C58.1811 1 59.4815 1.50373 60.4883 2.51118C61.495 3.43468 61.9984 4.61004 61.9984 6.03727V22.7862C63.0891 21.5269 64.5573 20.5194 66.403 19.7638C68.2488 19.0082 70.2204 18.6304 72.3178 18.6304C77.0161 18.6304 80.7915 20.0157 83.644 22.7862C86.5804 25.5567 88.0486 29.9643 88.0486 36.009V53.0098C88.0486 54.353 87.5033 55.4864 86.4126 56.4099C85.4058 57.2495 84.1054 57.6692 82.5114 57.6692C80.9173 57.6692 79.5749 57.2075 78.4843 56.284C77.4775 55.3605 76.9741 54.1851 76.9741 52.7579V37.3942C76.9741 34.2879 76.261 32.0631 74.8347 30.7199C73.4924 29.3766 71.8144 28.705 69.8009 28.705C67.7034 28.705 65.9835 29.4186 64.6412 30.8458C63.2988 32.1891 62.4179 33.7002 61.9984 35.3793V52.632C61.9984 54.0592 61.4531 55.2765 60.3624 56.284C59.3556 57.2075 58.0972 57.6692 56.587 57.6692Z" fill="url(#paint4_linear_809_1834)"/>
<path d="M112.376 9.31541C105.287 10.0754 102.882 22.2992 102.565 28.3161C100.287 29.0761 100.139 22.2992 100.35 18.8158C100.35 17.5491 99.7172 17.0213 99.4007 16.9157C97.9239 16.7046 94.6537 18.1191 93.3879 25.466C92.122 32.813 93.2305 38.8017 93.7355 40.9747C93.9361 41.8379 94.5902 43.6632 95.1622 44.9008C96.8117 48.4699 99.3143 51.8243 103.198 54.6004C108.515 58.4006 116.806 58.0839 120.287 57.4505C123.874 56.6061 130.127 53.2449 132.313 46.6835C134.528 40.0332 133.79 36.5498 133.262 35.9164C132.946 35.0719 131.743 33.383 129.465 33.383C127.186 33.383 126.195 35.4942 125.984 36.5498C125.878 36.7609 125.667 37.8165 125.667 40.3499C125.667 42.8833 123.557 45.4168 122.503 46.3668C120.182 47.6335 114.654 49.2169 111.11 45.4168C107.565 41.6166 109.211 37.4998 110.477 35.9164C111.215 34.8608 113.515 32.6863 116.806 32.4329C120.097 32.1796 123.241 35.0719 124.401 36.5498C124.148 33.763 127.039 31.5885 128.515 30.8495C125.667 27.9994 122.819 26.7327 121.553 26.0994C120.54 25.5927 120.92 23.8826 121.553 23.2493L131.68 11.5322L125.351 17.5491L126.808 16.1639L131.68 11.5322C131.996 10.7932 131.49 9.44209 126.933 9.94877C121.237 10.5821 114.591 21.6659 111.426 23.2493C108.895 24.516 110.16 20.8214 111.11 18.8158C112.059 17.2324 114.085 13.5589 114.591 11.5322C115.097 9.50542 113.325 9.20986 112.376 9.31541Z" fill="url(#paint5_linear_809_1834)"/>
<path d="M131.68 11.5322C131.996 10.7932 131.49 9.44209 126.933 9.94877C121.237 10.5821 114.591 21.6659 111.426 23.2493C108.895 24.516 110.16 20.8214 111.11 18.8158C112.059 17.2324 114.085 13.5589 114.591 11.5322C115.097 9.50542 113.325 9.20986 112.376 9.31541C105.287 10.0754 102.882 22.2992 102.565 28.3161C100.287 29.0761 100.139 22.2992 100.35 18.8158C100.35 17.5491 99.7172 17.0213 99.4007 16.9157C97.9239 16.7046 94.6537 18.1191 93.3879 25.466C92.122 32.813 93.2305 38.8017 93.7355 40.9747M131.68 11.5322L126.808 16.1639L125.351 17.5491L131.68 11.5322ZM131.68 11.5322L121.553 23.2493C120.92 23.8826 120.54 25.5927 121.553 26.0994C122.819 26.7327 125.667 27.9994 128.515 30.8495C127.039 31.5885 124.148 33.763 124.401 36.5498C123.241 35.0719 120.097 32.1796 116.806 32.4329C113.515 32.6863 111.215 34.8608 110.477 35.9164C109.211 37.4998 107.565 41.6166 111.11 45.4168C114.654 49.2169 120.182 47.6335 122.503 46.3668C123.557 45.4168 125.667 42.8833 125.667 40.3499C125.667 37.8165 125.878 36.7609 125.984 36.5498C126.195 35.4942 127.186 33.383 129.465 33.383C131.743 33.383 132.946 35.0719 133.262 35.9164C133.79 36.5498 134.528 40.0332 132.313 46.6835C130.127 53.2449 123.874 56.6061 120.287 57.4505C116.806 58.0839 108.515 58.4006 103.198 54.6004C99.3143 51.8243 96.8117 48.4699 95.1622 44.9008M93.7355 40.9747C93.9361 41.8379 94.5902 43.6632 95.1622 44.9008M93.7355 40.9747L95.1622 44.9008M156.656 57.6692C153.048 57.6692 149.734 56.8297 146.714 55.1506C143.693 53.4715 141.26 51.1628 139.415 48.2244C137.653 45.202 136.772 41.8019 136.772 38.0239C136.772 34.162 137.653 30.8038 139.415 27.9494C141.26 25.011 143.693 22.7442 146.714 21.1491C149.734 19.47 153.048 18.6304 156.656 18.6304C160.347 18.6304 163.661 19.47 166.597 21.1491C169.618 22.7442 172.009 25.011 173.771 27.9494C175.533 30.8038 176.413 34.162 176.413 38.0239C176.413 41.8019 175.533 45.202 173.771 48.2244C172.009 51.1628 169.618 53.4715 166.597 55.1506C163.661 56.8297 160.347 57.6692 156.656 57.6692ZM156.656 47.4688C159.256 47.4688 161.354 46.5873 162.948 44.8242C164.626 42.9772 165.465 40.7104 165.465 38.0239C165.465 35.2534 164.626 33.0286 162.948 31.3495C161.354 29.6704 159.256 28.8309 156.656 28.8309C154.139 28.8309 151.999 29.6704 150.237 31.3495C148.559 33.0286 147.721 35.2534 147.721 38.0239C147.721 40.7104 148.559 42.9772 150.237 44.8242C151.999 46.5873 154.139 47.4688 156.656 47.4688ZM192.916 57.6692C187.211 57.6692 182.513 56.4939 178.822 54.1431C178.067 53.6394 177.521 53.0517 177.186 52.3801C176.85 51.6245 176.682 50.9109 176.682 50.2393C176.682 48.812 177.144 47.5108 178.067 46.3354C179.073 45.16 180.29 44.5723 181.716 44.5723C182.387 44.5723 183.058 44.7403 183.73 45.0761C185.24 45.7477 186.96 46.3354 188.889 46.8391C190.819 47.2589 192.581 47.4688 194.175 47.4688C197.279 47.4688 198.831 46.7552 198.831 45.3279C198.831 44.4884 198.454 43.7748 197.699 43.1871C196.943 42.5155 195.182 42.0537 192.413 41.8019C191.322 41.7179 189.896 41.55 188.134 41.2981C186.456 41.0463 184.778 40.5845 183.1 39.9129C181.422 39.1573 179.996 38.0659 178.822 36.6387C177.731 35.2114 177.186 33.2805 177.186 30.8458C177.186 27.0679 178.612 24.0875 181.464 21.9047C184.317 19.7218 188.134 18.6304 192.916 18.6304C195.685 18.6304 198.286 18.9243 200.719 19.512C203.236 20.0996 205.123 20.9812 206.382 22.1565C207.556 23.2479 208.144 24.5072 208.144 25.9345C208.144 27.1938 207.682 28.3272 206.759 29.3346C205.837 30.3421 204.662 30.8458 203.236 30.8458C202.481 30.8458 201.768 30.6779 201.096 30.3421C200.09 29.6704 198.789 29.1667 197.195 28.8309C195.685 28.4951 194.133 28.3272 192.539 28.3272C189.351 28.3272 187.757 28.9988 187.757 30.3421C187.757 30.9298 188.05 31.4755 188.638 31.9792C189.309 32.399 190.777 32.7768 193.042 33.1126C194.468 33.2805 196.104 33.5323 197.95 33.8682C199.796 34.12 201.558 34.6237 203.236 35.3793C204.998 36.051 206.466 37.1844 207.64 38.7795C208.815 40.3746 209.402 42.5574 209.402 45.3279C209.402 49.1059 207.892 52.1282 204.872 54.395C201.851 56.5778 197.866 57.6692 192.916 57.6692ZM208.358 23.6677C208.358 21.9886 208.946 20.7293 210.12 19.8897C211.295 19.0502 212.637 18.6304 214.147 18.6304C215.322 18.6304 216.329 18.9662 217.168 19.6379C218.091 20.2256 218.72 21.0651 219.055 22.1565L226.858 41.1722C227.277 42.2636 227.865 42.8093 228.62 42.8093C229.375 42.8093 229.92 42.2636 230.256 41.1722L237.051 22.1565C237.471 20.9812 238.142 20.0996 239.065 19.512C240.072 18.9243 241.12 18.6304 242.211 18.6304C243.637 18.6304 244.938 19.0922 246.112 20.0157C247.371 20.9392 248 22.1565 248 23.6677C248 24.5072 247.832 25.3048 247.497 26.0604L227.865 71.3958C227.277 72.6551 226.522 73.5366 225.599 74.0403C224.76 74.628 223.879 74.9219 222.957 74.9219C221.446 74.9219 220.062 74.3762 218.804 73.2848C217.629 72.2773 217.042 71.06 217.042 69.6327C217.042 68.8772 217.21 68.2055 217.545 67.6178L224.341 55.5284C222.915 55.1086 221.782 54.0592 220.943 52.3801L208.736 25.9345C208.484 25.1789 208.358 24.4233 208.358 23.6677ZM45.0462 53.0098C43.4521 54.2691 41.0191 55.3605 37.7471 56.284C34.4751 57.2075 31.287 57.6692 28.1828 57.6692C22.9811 57.6692 18.3248 56.5359 14.2139 54.2691C10.1029 51.9184 6.87283 48.6861 4.5237 44.5723C2.17457 40.4586 1 35.7991 1 30.5939C1 25.1369 2.13262 20.4355 4.39785 16.4896C6.74698 12.5437 9.97703 9.52137 14.088 7.42251C18.199 5.2397 22.9811 4.14829 28.4345 4.14829C30.6997 4.14829 32.965 4.35818 35.2302 4.77795C37.5793 5.19772 39.7187 5.86936 41.6483 6.79286C42.6551 7.29658 43.3682 7.96822 43.7877 8.80776C44.2911 9.56335 44.5428 10.4029 44.5428 11.3264C44.5428 12.6697 44.0394 13.929 43.0327 15.1043C42.1098 16.1958 40.8513 16.7415 39.2573 16.7415C38.5861 16.7415 37.873 16.6155 37.1179 16.3637C35.6077 15.776 33.9717 15.3142 32.2099 14.9784C30.448 14.5586 28.8959 14.3488 27.5536 14.3488C23.1909 14.3488 19.5414 15.818 16.6049 18.7564C13.7524 21.6948 12.3262 25.6406 12.3262 30.5939C12.3262 35.8831 13.7944 40.0388 16.7308 43.0612C19.7511 46.0835 23.6104 47.5947 28.3086 47.5947C30.2383 47.5947 32.2938 47.2589 34.4751 46.5873C36.6564 45.9156 38.4183 45.0761 39.7607 44.0686C40.6835 43.4809 41.6903 43.1871 42.781 43.1871C44.2072 43.1871 45.3398 43.6908 46.1788 44.6983C47.1017 45.6218 47.5631 46.7971 47.5631 48.2244C47.5631 50.0714 46.7241 51.6665 45.0462 53.0098ZM56.587 57.6692C54.993 57.6692 53.6506 57.2075 52.5599 56.284C51.4693 55.3605 50.9239 54.1851 50.9239 52.7579V5.91133C50.9239 4.56806 51.4273 3.43468 52.4341 2.51118C53.5248 1.50373 54.9091 1 56.587 1C58.1811 1 59.4815 1.50373 60.4883 2.51118C61.495 3.43468 61.9984 4.61004 61.9984 6.03727V22.7862C63.0891 21.5269 64.5573 20.5194 66.403 19.7638C68.2488 19.0082 70.2204 18.6304 72.3178 18.6304C77.0161 18.6304 80.7915 20.0157 83.644 22.7862C86.5804 25.5567 88.0486 29.9643 88.0486 36.009V53.0098C88.0486 54.353 87.5033 55.4864 86.4126 56.4099C85.4058 57.2495 84.1054 57.6692 82.5114 57.6692C80.9173 57.6692 79.5749 57.2075 78.4843 56.284C77.4775 55.3605 76.9741 54.1851 76.9741 52.7579V37.3942C76.9741 34.2879 76.261 32.0631 74.8347 30.7199C73.4924 29.3766 71.8144 28.705 69.8009 28.705C67.7034 28.705 65.9835 29.4186 64.6412 30.8458C63.2988 32.1891 62.4179 33.7003 61.9984 35.3793V52.632C61.9984 54.0592 61.4531 55.2765 60.3624 56.284C59.3556 57.2075 58.0972 57.6692 56.587 57.6692Z" stroke="url(#paint6_linear_809_1834)" stroke-width="0.263406" stroke-linecap="round" stroke-linejoin="round"/>
<defs>
<linearGradient id="paint0_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint1_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint2_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint3_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint4_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint5_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint6_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
</defs>
</svg>
I tried many things, but the SVG file should be correct. When in Flutter, I see the image in white.
The error I get is:
════════ Exception caught by SVG ═══════════════════════════════════════════════
Failed to find definition for url(#paint6_linear_809_1834)
It happens for all the paintN_linear points.
Just move the defs to the top right below the svg tag.
Here's the result:
The XML is going to be like the following:
<svg width="249" height="76" viewBox="0 0 249 76" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="paint0_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint1_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint2_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint3_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint4_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint5_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
<linearGradient id="paint6_linear_809_1834" x1="1" y1="74.5218" x2="120.071" y2="-92.6821" gradientUnits="userSpaceOnUse">
<stop stop-color="#E96443"/>
<stop offset="1" stop-color="#904E95"/>
</linearGradient>
</defs>
<path d="M156.656 57.6692C153.048 57.6692 149.734 56.8297 146.714 55.1506C143.693 53.4715 141.26 51.1628 139.415 48.2244C137.653 45.202 136.772 41.8019 136.772 38.0239C136.772 34.162 137.653 30.8038 139.415 27.9494C141.26 25.011 143.693 22.7442 146.714 21.1491C149.734 19.47 153.048 18.6304 156.656 18.6304C160.347 18.6304 163.661 19.47 166.597 21.1491C169.618 22.7442 172.009 25.011 173.771 27.9494C175.533 30.8038 176.413 34.162 176.413 38.0239C176.413 41.8019 175.533 45.202 173.771 48.2244C172.009 51.1628 169.618 53.4715 166.597 55.1506C163.661 56.8297 160.347 57.6692 156.656 57.6692ZM156.656 47.4688C159.256 47.4688 161.354 46.5873 162.948 44.8242C164.626 42.9772 165.465 40.7104 165.465 38.0239C165.465 35.2534 164.626 33.0286 162.948 31.3495C161.354 29.6704 159.256 28.8309 156.656 28.8309C154.139 28.8309 151.999 29.6704 150.237 31.3495C148.559 33.0286 147.721 35.2534 147.721 38.0239C147.721 40.7104 148.559 42.9772 150.237 44.8242C151.999 46.5873 154.139 47.4688 156.656 47.4688Z" fill="url(#paint0_linear_809_1834)"/>
<path d="M192.916 57.6692C187.211 57.6692 182.513 56.4939 178.822 54.1432C178.067 53.6394 177.521 53.0517 177.186 52.3801C176.85 51.6245 176.682 50.9109 176.682 50.2393C176.682 48.812 177.144 47.5108 178.067 46.3354C179.073 45.16 180.29 44.5723 181.716 44.5723C182.387 44.5723 183.058 44.7403 183.73 45.0761C185.24 45.7477 186.96 46.3354 188.889 46.8391C190.819 47.2589 192.581 47.4688 194.175 47.4688C197.279 47.4688 198.831 46.7552 198.831 45.3279C198.831 44.4884 198.454 43.7748 197.699 43.1871C196.943 42.5155 195.182 42.0537 192.413 41.8019C191.322 41.7179 189.896 41.55 188.134 41.2981C186.456 41.0463 184.778 40.5845 183.1 39.9129C181.422 39.1573 179.996 38.0659 178.822 36.6387C177.731 35.2114 177.186 33.2805 177.186 30.8458C177.186 27.0679 178.612 24.0875 181.464 21.9047C184.317 19.7218 188.134 18.6304 192.916 18.6304C195.685 18.6304 198.286 18.9243 200.719 19.512C203.236 20.0996 205.123 20.9812 206.382 22.1565C207.556 23.2479 208.144 24.5072 208.144 25.9345C208.144 27.1938 207.682 28.3272 206.759 29.3346C205.837 30.3421 204.662 30.8458 203.236 30.8458C202.481 30.8458 201.768 30.6779 201.096 30.3421C200.09 29.6704 198.789 29.1667 197.195 28.8309C195.685 28.4951 194.133 28.3272 192.539 28.3272C189.351 28.3272 187.757 28.9988 187.757 30.3421C187.757 30.9298 188.05 31.4755 188.638 31.9792C189.309 32.399 190.777 32.7768 193.042 33.1126C194.468 33.2805 196.104 33.5323 197.95 33.8682C199.796 34.12 201.558 34.6237 203.236 35.3793C204.998 36.051 206.466 37.1844 207.64 38.7795C208.815 40.3746 209.402 42.5574 209.402 45.3279C209.402 49.1059 207.892 52.1282 204.872 54.395C201.851 56.5778 197.866 57.6692 192.916 57.6692Z" fill="url(#paint1_linear_809_1834)"/>
<path d="M208.358 23.6677C208.358 21.9886 208.946 20.7293 210.12 19.8897C211.295 19.0502 212.637 18.6304 214.147 18.6304C215.322 18.6304 216.329 18.9662 217.168 19.6379C218.091 20.2256 218.72 21.0651 219.055 22.1565L226.858 41.1722C227.277 42.2636 227.865 42.8093 228.62 42.8093C229.375 42.8093 229.92 42.2636 230.256 41.1722L237.051 22.1565C237.471 20.9812 238.142 20.0996 239.065 19.512C240.072 18.9243 241.12 18.6304 242.211 18.6304C243.637 18.6304 244.938 19.0922 246.112 20.0157C247.371 20.9392 248 22.1565 248 23.6677C248 24.5072 247.832 25.3048 247.497 26.0604L227.865 71.3958C227.277 72.6551 226.522 73.5366 225.599 74.0404C224.76 74.628 223.879 74.9219 222.957 74.9219C221.446 74.9219 220.062 74.3762 218.804 73.2848C217.629 72.2773 217.042 71.06 217.042 69.6327C217.042 68.8772 217.21 68.2055 217.545 67.6178L224.341 55.5284C222.915 55.1086 221.782 54.0592 220.943 52.3801L208.736 25.9345C208.484 25.1789 208.358 24.4233 208.358 23.6677Z" fill="url(#paint2_linear_809_1834)"/>
<path d="M45.0462 53.0098C43.4521 54.2691 41.0191 55.3605 37.7471 56.284C34.4751 57.2075 31.287 57.6692 28.1828 57.6692C22.9811 57.6692 18.3248 56.5359 14.2139 54.2691C10.1029 51.9184 6.87283 48.6861 4.5237 44.5723C2.17457 40.4586 1 35.7991 1 30.5939C1 25.1369 2.13262 20.4355 4.39785 16.4896C6.74698 12.5437 9.97703 9.52137 14.088 7.42251C18.199 5.2397 22.9811 4.14829 28.4345 4.14829C30.6997 4.14829 32.965 4.35818 35.2302 4.77795C37.5793 5.19772 39.7187 5.86936 41.6483 6.79286C42.6551 7.29658 43.3682 7.96822 43.7877 8.80776C44.2911 9.56335 44.5428 10.4029 44.5428 11.3264C44.5428 12.6697 44.0394 13.929 43.0327 15.1043C42.1098 16.1958 40.8513 16.7415 39.2573 16.7415C38.5861 16.7415 37.873 16.6155 37.1179 16.3637C35.6077 15.776 33.9717 15.3142 32.2099 14.9784C30.448 14.5586 28.8959 14.3488 27.5536 14.3488C23.1909 14.3488 19.5414 15.818 16.6049 18.7564C13.7524 21.6948 12.3262 25.6406 12.3262 30.5939C12.3262 35.8831 13.7944 40.0388 16.7308 43.0612C19.7511 46.0835 23.6104 47.5947 28.3086 47.5947C30.2383 47.5947 32.2938 47.2589 34.4751 46.5873C36.6564 45.9156 38.4183 45.0761 39.7607 44.0686C40.6835 43.4809 41.6903 43.1871 42.781 43.1871C44.2072 43.1871 45.3398 43.6908 46.1788 44.6983C47.1017 45.6218 47.5631 46.7971 47.5631 48.2244C47.5631 50.0714 46.7241 51.6665 45.0462 53.0098Z" fill="url(#paint3_linear_809_1834)"/>
<path d="M56.587 57.6692C54.993 57.6692 53.6506 57.2075 52.5599 56.284C51.4693 55.3605 50.9239 54.1851 50.9239 52.7579V5.91133C50.9239 4.56806 51.4273 3.43468 52.4341 2.51118C53.5248 1.50373 54.9091 1 56.587 1C58.1811 1 59.4815 1.50373 60.4883 2.51118C61.495 3.43468 61.9984 4.61004 61.9984 6.03727V22.7862C63.0891 21.5269 64.5573 20.5194 66.403 19.7638C68.2488 19.0082 70.2204 18.6304 72.3178 18.6304C77.0161 18.6304 80.7915 20.0157 83.644 22.7862C86.5804 25.5567 88.0486 29.9643 88.0486 36.009V53.0098C88.0486 54.353 87.5033 55.4864 86.4126 56.4099C85.4058 57.2495 84.1054 57.6692 82.5114 57.6692C80.9173 57.6692 79.5749 57.2075 78.4843 56.284C77.4775 55.3605 76.9741 54.1851 76.9741 52.7579V37.3942C76.9741 34.2879 76.261 32.0631 74.8347 30.7199C73.4924 29.3766 71.8144 28.705 69.8009 28.705C67.7034 28.705 65.9835 29.4186 64.6412 30.8458C63.2988 32.1891 62.4179 33.7002 61.9984 35.3793V52.632C61.9984 54.0592 61.4531 55.2765 60.3624 56.284C59.3556 57.2075 58.0972 57.6692 56.587 57.6692Z" fill="url(#paint4_linear_809_1834)"/>
<path d="M112.376 9.31541C105.287 10.0754 102.882 22.2992 102.565 28.3161C100.287 29.0761 100.139 22.2992 100.35 18.8158C100.35 17.5491 99.7172 17.0213 99.4007 16.9157C97.9239 16.7046 94.6537 18.1191 93.3879 25.466C92.122 32.813 93.2305 38.8017 93.7355 40.9747C93.9361 41.8379 94.5902 43.6632 95.1622 44.9008C96.8117 48.4699 99.3143 51.8243 103.198 54.6004C108.515 58.4006 116.806 58.0839 120.287 57.4505C123.874 56.6061 130.127 53.2449 132.313 46.6835C134.528 40.0332 133.79 36.5498 133.262 35.9164C132.946 35.0719 131.743 33.383 129.465 33.383C127.186 33.383 126.195 35.4942 125.984 36.5498C125.878 36.7609 125.667 37.8165 125.667 40.3499C125.667 42.8833 123.557 45.4168 122.503 46.3668C120.182 47.6335 114.654 49.2169 111.11 45.4168C107.565 41.6166 109.211 37.4998 110.477 35.9164C111.215 34.8608 113.515 32.6863 116.806 32.4329C120.097 32.1796 123.241 35.0719 124.401 36.5498C124.148 33.763 127.039 31.5885 128.515 30.8495C125.667 27.9994 122.819 26.7327 121.553 26.0994C120.54 25.5927 120.92 23.8826 121.553 23.2493L131.68 11.5322L125.351 17.5491L126.808 16.1639L131.68 11.5322C131.996 10.7932 131.49 9.44209 126.933 9.94877C121.237 10.5821 114.591 21.6659 111.426 23.2493C108.895 24.516 110.16 20.8214 111.11 18.8158C112.059 17.2324 114.085 13.5589 114.591 11.5322C115.097 9.50542 113.325 9.20986 112.376 9.31541Z" fill="url(#paint5_linear_809_1834)"/>
<path d="M131.68 11.5322C131.996 10.7932 131.49 9.44209 126.933 9.94877C121.237 10.5821 114.591 21.6659 111.426 23.2493C108.895 24.516 110.16 20.8214 111.11 18.8158C112.059 17.2324 114.085 13.5589 114.591 11.5322C115.097 9.50542 113.325 9.20986 112.376 9.31541C105.287 10.0754 102.882 22.2992 102.565 28.3161C100.287 29.0761 100.139 22.2992 100.35 18.8158C100.35 17.5491 99.7172 17.0213 99.4007 16.9157C97.9239 16.7046 94.6537 18.1191 93.3879 25.466C92.122 32.813 93.2305 38.8017 93.7355 40.9747M131.68 11.5322L126.808 16.1639L125.351 17.5491L131.68 11.5322ZM131.68 11.5322L121.553 23.2493C120.92 23.8826 120.54 25.5927 121.553 26.0994C122.819 26.7327 125.667 27.9994 128.515 30.8495C127.039 31.5885 124.148 33.763 124.401 36.5498C123.241 35.0719 120.097 32.1796 116.806 32.4329C113.515 32.6863 111.215 34.8608 110.477 35.9164C109.211 37.4998 107.565 41.6166 111.11 45.4168C114.654 49.2169 120.182 47.6335 122.503 46.3668C123.557 45.4168 125.667 42.8833 125.667 40.3499C125.667 37.8165 125.878 36.7609 125.984 36.5498C126.195 35.4942 127.186 33.383 129.465 33.383C131.743 33.383 132.946 35.0719 133.262 35.9164C133.79 36.5498 134.528 40.0332 132.313 46.6835C130.127 53.2449 123.874 56.6061 120.287 57.4505C116.806 58.0839 108.515 58.4006 103.198 54.6004C99.3143 51.8243 96.8117 48.4699 95.1622 44.9008M93.7355 40.9747C93.9361 41.8379 94.5902 43.6632 95.1622 44.9008M93.7355 40.9747L95.1622 44.9008M156.656 57.6692C153.048 57.6692 149.734 56.8297 146.714 55.1506C143.693 53.4715 141.26 51.1628 139.415 48.2244C137.653 45.202 136.772 41.8019 136.772 38.0239C136.772 34.162 137.653 30.8038 139.415 27.9494C141.26 25.011 143.693 22.7442 146.714 21.1491C149.734 19.47 153.048 18.6304 156.656 18.6304C160.347 18.6304 163.661 19.47 166.597 21.1491C169.618 22.7442 172.009 25.011 173.771 27.9494C175.533 30.8038 176.413 34.162 176.413 38.0239C176.413 41.8019 175.533 45.202 173.771 48.2244C172.009 51.1628 169.618 53.4715 166.597 55.1506C163.661 56.8297 160.347 57.6692 156.656 57.6692ZM156.656 47.4688C159.256 47.4688 161.354 46.5873 162.948 44.8242C164.626 42.9772 165.465 40.7104 165.465 38.0239C165.465 35.2534 164.626 33.0286 162.948 31.3495C161.354 29.6704 159.256 28.8309 156.656 28.8309C154.139 28.8309 151.999 29.6704 150.237 31.3495C148.559 33.0286 147.721 35.2534 147.721 38.0239C147.721 40.7104 148.559 42.9772 150.237 44.8242C151.999 46.5873 154.139 47.4688 156.656 47.4688ZM192.916 57.6692C187.211 57.6692 182.513 56.4939 178.822 54.1431C178.067 53.6394 177.521 53.0517 177.186 52.3801C176.85 51.6245 176.682 50.9109 176.682 50.2393C176.682 48.812 177.144 47.5108 178.067 46.3354C179.073 45.16 180.29 44.5723 181.716 44.5723C182.387 44.5723 183.058 44.7403 183.73 45.0761C185.24 45.7477 186.96 46.3354 188.889 46.8391C190.819 47.2589 192.581 47.4688 194.175 47.4688C197.279 47.4688 198.831 46.7552 198.831 45.3279C198.831 44.4884 198.454 43.7748 197.699 43.1871C196.943 42.5155 195.182 42.0537 192.413 41.8019C191.322 41.7179 189.896 41.55 188.134 41.2981C186.456 41.0463 184.778 40.5845 183.1 39.9129C181.422 39.1573 179.996 38.0659 178.822 36.6387C177.731 35.2114 177.186 33.2805 177.186 30.8458C177.186 27.0679 178.612 24.0875 181.464 21.9047C184.317 19.7218 188.134 18.6304 192.916 18.6304C195.685 18.6304 198.286 18.9243 200.719 19.512C203.236 20.0996 205.123 20.9812 206.382 22.1565C207.556 23.2479 208.144 24.5072 208.144 25.9345C208.144 27.1938 207.682 28.3272 206.759 29.3346C205.837 30.3421 204.662 30.8458 203.236 30.8458C202.481 30.8458 201.768 30.6779 201.096 30.3421C200.09 29.6704 198.789 29.1667 197.195 28.8309C195.685 28.4951 194.133 28.3272 192.539 28.3272C189.351 28.3272 187.757 28.9988 187.757 30.3421C187.757 30.9298 188.05 31.4755 188.638 31.9792C189.309 32.399 190.777 32.7768 193.042 33.1126C194.468 33.2805 196.104 33.5323 197.95 33.8682C199.796 34.12 201.558 34.6237 203.236 35.3793C204.998 36.051 206.466 37.1844 207.64 38.7795C208.815 40.3746 209.402 42.5574 209.402 45.3279C209.402 49.1059 207.892 52.1282 204.872 54.395C201.851 56.5778 197.866 57.6692 192.916 57.6692ZM208.358 23.6677C208.358 21.9886 208.946 20.7293 210.12 19.8897C211.295 19.0502 212.637 18.6304 214.147 18.6304C215.322 18.6304 216.329 18.9662 217.168 19.6379C218.091 20.2256 218.72 21.0651 219.055 22.1565L226.858 41.1722C227.277 42.2636 227.865 42.8093 228.62 42.8093C229.375 42.8093 229.92 42.2636 230.256 41.1722L237.051 22.1565C237.471 20.9812 238.142 20.0996 239.065 19.512C240.072 18.9243 241.12 18.6304 242.211 18.6304C243.637 18.6304 244.938 19.0922 246.112 20.0157C247.371 20.9392 248 22.1565 248 23.6677C248 24.5072 247.832 25.3048 247.497 26.0604L227.865 71.3958C227.277 72.6551 226.522 73.5366 225.599 74.0403C224.76 74.628 223.879 74.9219 222.957 74.9219C221.446 74.9219 220.062 74.3762 218.804 73.2848C217.629 72.2773 217.042 71.06 217.042 69.6327C217.042 68.8772 217.21 68.2055 217.545 67.6178L224.341 55.5284C222.915 55.1086 221.782 54.0592 220.943 52.3801L208.736 25.9345C208.484 25.1789 208.358 24.4233 208.358 23.6677ZM45.0462 53.0098C43.4521 54.2691 41.0191 55.3605 37.7471 56.284C34.4751 57.2075 31.287 57.6692 28.1828 57.6692C22.9811 57.6692 18.3248 56.5359 14.2139 54.2691C10.1029 51.9184 6.87283 48.6861 4.5237 44.5723C2.17457 40.4586 1 35.7991 1 30.5939C1 25.1369 2.13262 20.4355 4.39785 16.4896C6.74698 12.5437 9.97703 9.52137 14.088 7.42251C18.199 5.2397 22.9811 4.14829 28.4345 4.14829C30.6997 4.14829 32.965 4.35818 35.2302 4.77795C37.5793 5.19772 39.7187 5.86936 41.6483 6.79286C42.6551 7.29658 43.3682 7.96822 43.7877 8.80776C44.2911 9.56335 44.5428 10.4029 44.5428 11.3264C44.5428 12.6697 44.0394 13.929 43.0327 15.1043C42.1098 16.1958 40.8513 16.7415 39.2573 16.7415C38.5861 16.7415 37.873 16.6155 37.1179 16.3637C35.6077 15.776 33.9717 15.3142 32.2099 14.9784C30.448 14.5586 28.8959 14.3488 27.5536 14.3488C23.1909 14.3488 19.5414 15.818 16.6049 18.7564C13.7524 21.6948 12.3262 25.6406 12.3262 30.5939C12.3262 35.8831 13.7944 40.0388 16.7308 43.0612C19.7511 46.0835 23.6104 47.5947 28.3086 47.5947C30.2383 47.5947 32.2938 47.2589 34.4751 46.5873C36.6564 45.9156 38.4183 45.0761 39.7607 44.0686C40.6835 43.4809 41.6903 43.1871 42.781 43.1871C44.2072 43.1871 45.3398 43.6908 46.1788 44.6983C47.1017 45.6218 47.5631 46.7971 47.5631 48.2244C47.5631 50.0714 46.7241 51.6665 45.0462 53.0098ZM56.587 57.6692C54.993 57.6692 53.6506 57.2075 52.5599 56.284C51.4693 55.3605 50.9239 54.1851 50.9239 52.7579V5.91133C50.9239 4.56806 51.4273 3.43468 52.4341 2.51118C53.5248 1.50373 54.9091 1 56.587 1C58.1811 1 59.4815 1.50373 60.4883 2.51118C61.495 3.43468 61.9984 4.61004 61.9984 6.03727V22.7862C63.0891 21.5269 64.5573 20.5194 66.403 19.7638C68.2488 19.0082 70.2204 18.6304 72.3178 18.6304C77.0161 18.6304 80.7915 20.0157 83.644 22.7862C86.5804 25.5567 88.0486 29.9643 88.0486 36.009V53.0098C88.0486 54.353 87.5033 55.4864 86.4126 56.4099C85.4058 57.2495 84.1054 57.6692 82.5114 57.6692C80.9173 57.6692 79.5749 57.2075 78.4843 56.284C77.4775 55.3605 76.9741 54.1851 76.9741 52.7579V37.3942C76.9741 34.2879 76.261 32.0631 74.8347 30.7199C73.4924 29.3766 71.8144 28.705 69.8009 28.705C67.7034 28.705 65.9835 29.4186 64.6412 30.8458C63.2988 32.1891 62.4179 33.7003 61.9984 35.3793V52.632C61.9984 54.0592 61.4531 55.2765 60.3624 56.284C59.3556 57.2075 58.0972 57.6692 56.587 57.6692Z" stroke="url(#paint6_linear_809_1834)" stroke-width="0.263406" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

How do I reformat an existing XML document with PowerShell

I'm trying to update an XML document from this:
<Enclave id="OLD">
<device>
<name>MGMT</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
</Enclave>
<Enclave id="NEW">
<device>
<name>G-VDS-GooD</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC001</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC002</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
</Enclave>
To this:
<Enclave id="OLD">
<device>
<name>MGMT</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
</Enclave>
<Enclave id="NEW">
<device>
<name>G-VDS-GooD</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC001</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<cert>
<inform>PEM</inform>
<outform>PEM</outform>
<name>G-VDS-ENC001</name>
<type>WEBServer</type>
<pwd>Password</pwd>
<altSubject />
</cert>
<RequireCert>1</RequireCert>
</device>
<device>
<name>G-VDS-ENC002</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<cert>
<inform>PEM</inform>
<outform>PEM</outform>
<name>G-VDS-ENC002</name>
<type>WEBServer</type>
<pwd>Password</pwd>
<altSubject />
</cert>
<RequireCert>1</RequireCert>
</device>
</Enclave>
I've written some PowerShell commands (see below) but only have been able to get this far:
<Enclave id="OLD">
<device>
<name>MGMT</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
</Enclave>
<Enclave id="NEW">
<device>
<name>G-VDS-GooD</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC001</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<cert>
<inform>PEM</inform>
<outform>PEM</outform>
<type>WEBServer</type>
<pwd>Password</pwd>
<altSubject />
</cert>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC002</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<cert>
<inform>PEM</inform>
<outform>PEM</outform>
<type>WEBServer</type>
<pwd>Password</pwd>
<altSubject />
</cert>
<RequireCert>1</RequireCert>
<RequireCert>0</RequireCert>
</device>
</Enclave>
Here is my PowerShell code:
$LoadType = "NEW"
$FileName = "C:\Voip.xml"
[xml]$FileOriginal = Get-Content $FileName
$Pattern = $FileOriginal.SelectNodes("/Configuration/Enclave[#id = `"$LoadType`"]/device[name[contains(text(), 'G-VDS-ENC')]]")
foreach($Pat in $Pattern) {
$inform = $FileOriginal.SelectSingleNode("/Configuration/Enclave[#id = `"$LoadType`"]/device[name[contains(text(), 'G-VDS-ENC')]]/inform")
$inform.ParentNode.RemoveChild($inform) | Out-Null
$outform = $FileOriginal.SelectSingleNode("/Configuration/Enclave[#id = `"$LoadType`"]/device[name[contains(text(), 'G-VDS-ENC')]]/outform")
$outform.ParentNode.RemoveChild($outform) | Out-Null
$RequireCert = $FileOriginal.SelectSingleNode("/Configuration/Enclave[#id = `"$LoadType`"]/device[name[contains(text(), 'G-VDS-ENC')]]/RequireCert")
$RequireCert.ParentNode.RemoveChild($RequireCert) | Out-Null
# Create cert element
$cert = $FileOriginal.CreateElement('cert')
$newinform = $FileOriginal.CreateElement('inform')
$newinform.InnerText = 'PEM'
$newoutform = $FileOriginal.CreateElement('outform')
$newoutform.InnerText = 'PEM'
$type = $FileOriginal.CreateElement('type')
$type.InnerText = 'WebServer'
$pwd = $FileOriginal.CreateElement('pwd')
$pwd.InnerText = 'password'
$altSubject = $FileOriginal.CreateElement('altSubject')
$cert.AppendChild($newinform)
$cert.AppendChild($newoutform)
#$cert.AppendChild($name)
$cert.AppendChild($type)
$cert.AppendChild($pwd)
$cert.AppendChild($altSubject)
# Insert cert element after 'vlan' element
$Pat.InsertAfter( $cert, $Pat.SelectSingleNode('vlan') )
$newRequireCert = $FileOriginal.CreateElement('RequireCert')
$newRequireCert.InnerText = "1"
$Pat.InsertAfter( $newRequireCert, $Pat.SelectSingleNode('cert') )
}
$FileOriginal.Save($FileName)
I couldn't get the "RequireCert" node to appear correctly with a 1 attribute in both the G-VDS-ENC001 & G-VDS-ENC002 nodes. Also, I couldn't come up with any syntax on how to clone or copy both the G-VDS-ENC001 & G-VDS-ENC002 Node elements into the newly created Cert node. Can anyone help me figure out what else is needed or go over my poor PowerShell code.
You can update the existing RequireCert node instead of removing+recreating it:
# Select the node
$RequireCert = $FileOriginal.SelectSingleNode("/Configuration/Enclave[#id = `"$LoadType`"]/device[name[contains(text(), 'G-VDS-ENC')]]/RequireCert")
# Set the node's text value
$RequireCert.'#Text' = 1
Then you can remove the $newRequireCert section in your current code.
I agree with Cpt.Whale you need not remove and recreate the RequireCert node.
Using dot notation you can update these nodes like this:
(($FileOriginal.Configuration.Enclave | Where-Object { $_.id -eq $LoadType }).device |
Where-Object { $_.name -like 'G-VDS-ENC*' }) | ForEach-Object { $_.RequireCert = '1' }

Correct PowerShell syntax for XML Node Loop value change

I have another question. I have an XML document that I would like to update a couple of nodes. I'm looking to copy/clone the device name node to a new node. For a more of an understanding here is the sample XML document:
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Enclave id="OLD">
<device>
<name>G-VDS-GooD</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC001</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC002</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
</Enclave>
</Configuration>
Here is what I'm trying to get to:
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Enclave id="OLD">
<device>
<name>G-VDS-GooD</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC001</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<cert>
<name>G-VDS-ENC001</name>
</cert>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC002</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<cert>
<name>G-VDS-ENC002</name>
</cert>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
</Enclave>
</Configuration>
Here is my code:
$LoadType = "OLD"
$FileName = "C:\name.xml"
[xml]$FileOriginal = Get-Content $FileName
$Pattern = $FileOriginal.SelectNodes("/Configuration/Enclave[#id = `"$LoadType`"]/device[name[contains(text(), 'G-VDS-ENC')]]")
foreach($Pat in $Pattern) {
$device = $FileOriginal.SelectSingleNode("//Configuration/Enclave[#id = `"$LoadType`"]/device[name[contains(text(), 'G-VDS-ENC')]]")
$devicename = $device.name;
$name = $FileOriginal.CreateElement('name')
foreach($name in $device) {
$devicename = $device.name;
$name = $FileOriginal.CreateElement('name')
$name.InnerText = "$devicename"
}
$cert = $FileOriginal.CreateElement('cert')
$cert.AppendChild($name)
$Pat.InsertAfter( $cert, $Pat.SelectSingleNode('vlan') )
}
$FileOriginal.Save($FileName)
Here was the result:
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Enclave id="OLD">
<device>
<name>G-VDS-GooD</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC001</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<cert>
<name>G-VDS-ENC001</name>
</cert>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
<device>
<name>G-VDS-ENC002</name>
<type>VoIP</type>
<vlan>Voice2Network</vlan>
<cert>
<name>G-VDS-ENC001</name>
</cert>
<inform>PEM</inform>
<outform>PEM</outform>
<RequireCert>0</RequireCert>
</device>
</Enclave>
</Configuration>
I tried to accomplish this through a foreach syntax but I don't know or think thats the correct approach. I also tried a different approach in using the CloneNode cmdlet but I couldn't get that to work either. Anyone have an idea on how to make this work?
I think the code is trying to do too much. Some minor simplification should make it work as desired:
$LoadType = "OLD"
$FileName = "c:\name.xml"
[xml]$FileOriginal = Get-Content $FileName
$Pattern = $FileOriginal.SelectNodes("/Configuration/Enclave[#id = `"$LoadType`"]/device[name[contains(text(), 'G-VDS-ENC')]]")
foreach($Pat in $Pattern) {
# new name node
$name = $FileOriginal.CreateElement('name')
# set node text to the current device name
$name.InnerText = $Pat.name
# new cert node
$cert = $FileOriginal.CreateElement('cert')
# add name node as child of cert node
$cert.AppendChild($name)
# insert new cert node after current device's vlan node
$Pat.InsertAfter( $cert, $Pat.SelectSingleNode('vlan') )
}
$FileOriginal.Save($FileName)

ios : parsing JSON having Arabic words return NULL

I am trying to parse JSON from Google Addresses which works fine if there is no arabic word/Address in JSON response. If there are Arabic word in JSON response
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
This giving null as a response String.
code to get Data from Google and send to parser
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
[responseData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responseData appendData:data];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
self.responseData = nil;
}
#pragma mark JSON and XML parsing NSXMLPARSER
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
if([getMode isEqualToString:#"0"])//JSON
{
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSLog(#"responseString: %#", responseString);
}
Google Query to get data and show responseString as NULL
http://maps.google.com/maps/nav?q=from:King%20Khalid%20Tunnel,%20Mecca%2024248%20to:3748,%20%20Al%20Hindawiyyah,%20Mecca%2024232&sensor=true&key=AIzaSyB4A8OGSdi_rsBsYl3_OCap6zAA1wXSRJg
I copied this NSMutibleData from NSLog
<7b226e61 6d65223a 2266726f 6d3a4b69 6e67204b 68616c69 64205475 6e6e656c 2c204d65 63636120 32343234 3820746f 3a333732 312c2020 416c2048 696e6461 77697979 61682c20 4d656363 61203234 32333222 2c225374 61747573 223a7b22 636f6465 223a3230 302c2272 65717565 7374223a 22646972 65637469 6f6e7322 7d2c2250 6c616365 6d61726b 223a5b7b 22696422 3a22222c 22616464 72657373 223a224b 696e6720 4b68616c 69642054 756e6e65 6c2c204d 65636361 20536175 64692041 72616269 61222c22 41646472 65737344 65746169 6c73223a 7b22436f 756e7472 79223a7b 22436f75 6e747279 4e616d65 436f6465 223a2253 41222c22 436f756e 7472794e 616d6522 3a225361 75646920 41726162 6961222c 2241646d 696e6973 74726174 69766541 72656122 3a7b2241 646d696e 69737472 61746976 65417265 614e616d 65223a22 4d616b6b 61682050 726f7669 6e636522 2c224c6f 63616c69 7479223a 7b224c6f 63616c69 74794e61 6d65223a 224d6563 6361222c 2254686f 726f7567 68666172 65223a7b 2254686f 726f7567 68666172 654e616d 65223a22 4b696e67 204b6861 6c696420 54756e6e 656c227d 7d7d7d2c 22416363 75726163 79223a20 367d2c22 506f696e 74223a7b 22636f6f 7264696e 61746573 223a5b33 392e3839 33393935 2c32312e 34323737 31322c30 5d7d7d2c 7b226964 223a2222 2c226164 64726573 73223a22 38343436 2c20416c 2048696e 64617769 79796168 2c204d61 6b6b6168 20323432 3332a033 3732312c 20536175 64692041 72616269 61222c22 41646472 65737344 65746169 6c73223a 7b22436f 756e7472 79223a7b 22436f75 6e747279 4e616d65 436f6465 223a2253 41222c22 436f756e 7472794e 616d6522 3a225c75 30363237 5c753036 34345c75 30363333 5c753036 33395c75 30363438 5c753036 32465c75 30363441 5c753036 3239222c 224c6f63 616c6974 79223a7b 224c6f63 616c6974 794e616d 65223a22 5c753036 34355c75 30363433 5c753036 3239222c 22446570 656e6465 6e744c6f 63616c69 7479223a 7b224465 70656e64 656e744c 6f63616c 6974794e 616d6522 3a225c75 30363237 5c753036 34345c75 30363437 5c753036 34365c75 30363246 5c753036 32375c75 30363438 5c753036 34415c75 30363239 222c2241 64647265 73734c69 6e65223a 5b223834 3436225d 2c22506f 7374616c 436f6465 223a7b22 506f7374 616c436f 64654e75 6d626572 223a2232 34323332 a0333732 31227d7d 7d7d2c22 41636375 72616379 223a2038 7d2c2250 6f696e74 223a7b22 636f6f72 64696e61 74657322 3a5b3339 2e373936 3433342c 32312e34 31363737 302c305d 7d7d5d2c 22446972 65637469 6f6e7322 3a7b2263 6f707972 69676874 7348746d 6c223a22 4d617020 64617461 20a93230 31332047 6f6f676c 65222c22 73756d6d 61727948 746d6c22 3a223134 2e355c75 30303236 6e627370 3b6b6d20 2861626f 75742031 37206d69 6e732922 2c224469 7374616e 6365223a 7b226d65 74657273 223a3134 3532372c 2268746d 6c223a22 31342e35 5c753030 32366e62 73703b6b 6d227d2c 22447572 6174696f 6e223a7b 22736563 6f6e6473 223a3939 312c2268 746d6c22 3a223137 206d696e 73227d2c 22526f75 74657322 3a5b7b22 44697374 616e6365 223a7b22 6d657465 7273223a 31343532 372c2268 746d6c22 3a223134 2e355c75 30303236 6e627370 3b6b6d22 7d2c2244 75726174 696f6e22 3a7b2273 65636f6e 6473223a 3939312c 2268746d 6c223a22 3137206d 696e7322 7d2c2273 756d6d61 72794874 6d6c223a 2231342e 355c7530 3032366e 6273703b 6b6d2028 61626f75 74203137 206d696e 7329222c 22537465 7073223a 5b7b2264 65736372 69707469 6f6e4874 6d6c223a 22486561 64205c75 30303343 625c7530 30334573 6f757468 77657374 5c753030 33435c2f 625c7530 30334520 6f6e205c 75303033 43625c75 30303345 4b696e67 204b6861 6c696420 54756e6e 656c5c75 30303343 5c2f625c 75303033 4520746f 77617264 205c7530 30334362 5c753030 33454b69 6e67204b 68616c69 64204272 69646765 5c753030 33435c2f 625c7530 30334522 2c224469 7374616e 6365223a 7b226d65 74657273 223a3133 32372c22 68746d6c 223a2231 2e335c75 30303236 6e627370 3b6b6d22 7d2c2244 75726174 696f6e22 3a7b2273 65636f6e 6473223a 36362c22 68746d6c 223a2231 206d696e 227d2c22 506f696e 74223a7b 22636f6f 7264696e 61746573 223a5b33 392e3839 33393935 2c32312e 34323737 31322c30 5d7d7d2c 7b226465 73637269 7074696f 6e48746d 6c223a22 54616b65 20746865 2072616d 70206f6e 746f205c 75303033 43625c75 30303345 4b696e67 20466168 64205264 5c753030 33435c2f 625c7530 3033455c 75303033 43646976 20636c61 73733d5c 225c225c 75303033 45436f6e 74696e75 6520746f 20666f6c 6c6f7720 5c753030 33437370 616e2064 69723d5c 2272746c 5c225c75 30303345 5c753036 33375c75 30363331 5c753036 34415c75 30363432 205c7530 3632375c 75303634 345c7530 3634355c 75303634 345c7530 36343320 5c753036 34315c75 30363437 5c753036 32465c75 30303343 5c2f7370 616e5c75 30303345 5c753230 30455c75 30303343 5c2f6469 765c7530 30334522 2c224469 7374616e 6365223a 7b226d65 74657273 223a3631 33372c22 68746d6c 223a2236 2e315c75 30303236 6e627370 3b6b6d22 7d2c2244 75726174 696f6e22 3a7b2273 65636f6e 6473223a 3435362c 2268746d 6c223a22 38206d69 6e73227d 2c22506f 696e7422 3a7b2263 6f6f7264 696e6174 6573223a 5b33392e 38383430 35382c32 312e3432 30323738 2c305d7d 7d2c7b22 64657363 72697074 696f6e48 746d6c22 3a22436f 6e74696e 7565206f 6e746f20 5c753030 3343625c 75303033 45536563 6f6e6420 52696e67 20526f61 645c7530 3033435c 2f625c75 30303345 222c2244 69737461 6e636522 3a7b226d 65746572 73223a35 3039302c 2268746d 6c223a22 352e315c 75303032 366e6273 703b6b6d 227d2c22 44757261 74696f6e 223a7b22 7365636f 6e647322 3a323238 2c226874 6d6c223a 2234206d 696e7322 7d2c2250 6f696e74 223a7b22 636f6f72 64696e61 74657322 3a5b3339 2e383334 3631332c 32312e34 32363638 372c305d 7d7d2c7b 22646573 63726970 74696f6e 48746d6c 223a2243 6f6e7469 6e756520 6f6e746f 205c7530 30334362 5c753030 3345416c 20416d69 72204e61 73617220 49626e20 4d617375 645c7530 3033435c 2f625c75 30303345 222c2244 69737461 6e636522 3a7b226d 65746572 73223a37 39312c22 68746d6c 223a2238 30305c75 30303236 6e627370 3b6d227d 2c224475 72617469 6f6e223a 7b227365 636f6e64 73223a37 392c2268 746d6c22 3a223120 6d696e22 7d2c2250 6f696e74 223a7b22 636f6f72 64696e61 74657322 3a5b3339 2e373938 3739362c 32312e34 30393237 312c305d 7d7d2c7b 22646573 63726970 74696f6e 48746d6c 223a2254 75726e20 72696768 74206f6e 746f205c 75303033 43625c75 30303345 416c2041 6e6a616c 5c753030 33435c2f 625c7530 30334522 2c224469 7374616e 6365223a 7b226d65 74657273 223a3238 312c2268 746d6c22 3a223238 305c7530 3032366e 6273703b 6d227d2c 22447572 6174696f 6e223a7b 22736563 6f6e6473 223a3337 2c226874 6d6c223a 22333720 73656373 227d2c22 506f696e 74223a7b 22636f6f 7264696e 61746573 223a5b33 392e3739 31353736 2c32312e 34313030 32392c30 5d7d7d2c 7b226465 73637269 7074696f 6e48746d 6c223a22 5475726e 20726967 6874206f 6e746f20 5c753030 3343625c 75303033 454d6173 6a696420 416c2041 6d697220 41686d61 645c7530 3033435c 2f625c75 30303345 222c2244 69737461 6e636522 3a7b226d 65746572 73223a34 35362c22 68746d6c 223a2234 35305c75 30303236 6e627370 3b6d227d 2c224475 72617469 6f6e223a 7b227365 636f6e64 73223a35 362c2268 746d6c22 3a223536 20736563 73227d2c 22506f69 6e74223a 7b22636f 6f726469 6e617465 73223a5b 33392e37 39323236 362c3231 2e343132 3437352c 305d7d7d 2c7b2264 65736372 69707469 6f6e4874 6d6c223a 2254616b 65207468 6520326e 64207269 67687420 6f6e746f 205c7530 30334362 5c753030 3345416c 20426173 69726168 5c753030 33435c2f 625c7530 30334522 2c224469 7374616e 6365223a 7b226d65 74657273 223a3231 322c2268 746d6c22 3a223231 305c7530 3032366e 6273703b 6d227d2c 22447572 6174696f 6e223a7b 22736563 6f6e6473 223a3333 2c226874 6d6c223a 22333320 73656373 227d2c22 506f696e 74223a7b 22636f6f 7264696e 61746573 223a5b33 392e3739 34393539 2c32312e 34313530 36352c30 5d7d7d2c 7b226465 73637269 7074696f 6e48746d 6c223a22 54616b65 20746865 20317374 206c6566 745c7530 30334364 69762063 6c617373 3d5c2267 6f6f676c 655f6e6f 74655c22 5c753030 33454465 7374696e 6174696f 6e207769 6c6c2062 65206f6e 20746865 206c6566 745c7530 3033435c 2f646976 5c753030 3345222c 22446973 74616e63 65223a7b 226d6574 65727322 3a323333 2c226874 6d6c223a 22323330 5c753030 32366e62 73703b6d 227d2c22 44757261 74696f6e 223a7b22 7365636f 6e647322 3a33362c 2268746d 6c223a22 33362073 65637322 7d2c2250 6f696e74 223a7b22 636f6f72 64696e61 74657322 3a5b3339 2e373936 3739362c 32312e34 31343730 342c305d 7d7d5d2c 22456e64 223a7b22 636f6f72 64696e61 74657322 3a5b3339 2e373936 3536382c 32312e34 31363734 372c305d 7d7d5d7d 7d>
The response data is not valid UTF-8. For example, it contains a non-breaking space encoded as A0 in "Makkah 24232 3748", so it is probably some ISO-Latin encoding.
If you add "oe=utf-8" to your request parameters, then you will get valid UTF-8 (and responseString is not nil, I checked it :-).
The URL then looks like this:
http://maps.google.com/maps/nav?oe=utf-8&q=from:....