Decoding/Parsing XML?

How can I parse a response of this type -

From what I understand this is XML but the decode xml block of the web component doesn't work plz help

What do you mean ? Show the output...

Also share your xml as text so that others can try it out / test with it.

https://pastebin.com/bYzte2PT
giving response

<queryresult success="true" error="false" numpods="4" datatypes="Solve" timedout="" timedoutpods="" timing="1.2770000000000001" parsetiming="0.41500000000000004" parsetimedout="false" recalculate="" id="MSPa1074519d49ide6f930bcd000066b5bd1icf12idfh" host="http://www4b.wolframalpha.com" server="10" related="http://www4b.wolframalpha.com/api/v2/relatedQueries.jsp?id=MSPa1074619d49ide6f930bcd0000298e3aa6fa1ih9306568059217232548068" version="2.6">
  <pod title="Input interpretation" scanner="Identity" id="Input" position="100" error="false" numsubpods="1">
  <subpod title="">
    <plaintext>solve 3 x - 7 = 11</plaintext>
  </subpod>
  </pod>
  <pod title="Results" scanner="Solve" id="Result" position="200" error="false" numsubpods="2" primary="true">
  <subpod title="">
    <plaintext>x = 6</plaintext>
  </subpod>
  <subpod title="Possible intermediate steps">
    <plaintext>Solve for x:
3 x - 7 = 11
Add 7 to both sides:
3 x + (7 - 7) = 7 + 11
7 - 7 = 0:
3 x = 11 + 7
11 + 7 = 18:
3 x = 18
Divide both sides of 3 x = 18 by 3:
(3 x)/3 = 18/3
3/3 = 1:
x = 18/3
The gcd of 18 and 3 is 3, so 18/3 = (3×6)/(3×1) = 3/3×6 = 6:
Answer: |  
 | x = 6</plaintext>
  </subpod>
  <states count="1">
    <state name="Hide steps" input="Result__Hide steps" />
  </states>
  </pod>
</queryresult>

This is what it returns -

The blocks -
image

Yes

appears to be parsing it correctly. What is the problem?

I thought decode meant that it would convert it to a "normal" format how can I just get the <plaintext> part @TIMAI2 u there ?

Quick and d#rty solution:

1 Like

not able to replace ">" and "</" with replace all block

it was for appathon and the submittions are closed now :sob: would be gr8 if the @MIT team could extend it for a few hours but i guess they would not :man_shrugging:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.