提取XML变量

时间:2014-09-19 13:22:26

标签: php xml

我已经尝试过搜索并发现了类似的问题,但似乎无法实现这一目标。我需要从网站中作为POST变量发送的XML中提取一些数据。在以下XML中,我需要提取变量名称SCHOOLDFE的响应,但无法找到方法。先谢谢你们!

--------------------------
<quizReport xsi:schemaLocation=\"http://www.ispringsolutions.com/ispring/quizbuilder/quizresults quizReport.xsd\" version=\"1\" xmlns=\"http://www.ispringsolutions.com/ispring/quizbuilder/quizresults\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
  <quizSettings quizType=\"graded\" maxScore=\"10\" maxNormalizedScore=\"100\" timeLimit=\"0\">
    <passingPercent>0.8</passingPercent>
  </quizSettings>
  <summary score=\"0\" percent=\"0\" time=\"1\">
    <variables>
      <variable name=\"USER_NAME\" title=\"Name\" value=\"JOHN\"/>
      <variable name=\"CLASS\" title=\"Class\" value=\"6M\"/>
      <variable name=\"SCHOOLDFE\" title=\"School DFE\" value=\"2112377\"/>
    </variables>
  </summary>
  <questions>
    <sequenceQuestion id=\"{7B5A5595-5F1E-415B-BA8C-8C700372FC4F}\" status=\"incorrect\" maxPoints=\"10\" maxAttempts=\"1\" awardedPoints=\"0\" usedAttempts=\"1\">
      <direction>Arrange the following items in the correct order</direction>
      <answers>
        <answer userDefinedPosition=\"1\">Item 1</answer>
        <answer userDefinedPosition=\"0\">Item 2</answer>
        <answer userDefinedPosition=\"2\">Item 3</answer>
        <answer userDefinedPosition=\"3\">Item 4</answer>
      </answers>
    </sequenceQuestion>
  </questions>
</quizReport>

0 个答案:

没有答案