无法使用xsl获取xml标记的值 - (xsl:value-of)

时间:2016-01-25 08:30:58

标签: html xml xslt

XML代码:

func play( data: NSData ) {
var audioFile: AVAudioFile
var audioBuffer: AVAudioPCMBuffer
// writing the data
let destPath = NSTemporaryDirectory() + "chunk.mp3"
data.writeToFile( destPath, atomically: true )
// initializing the AVAudioFile
audioFile = AVAudioFile( forReading: NSURL(string: destPath)!)
// initializing the AVAudioPCMBuffer
audioBuffer = AVAudioPCMBuffer(PCMFormat: audioFile.processingFormat,
                               frameCapacity: UInt32(data.length))
audioFile.readIntoBuffer( audioBuffer )
/*
    I didn't put any AVAudioPlayerNode/AVAudioEngine in this code to keep it simple and describe the situation,
    anyway this works fine when everything's properly initialized:
*/
player.scheduleBuffer( audioBuffer, completionHandler: nil )
}

XSL代码:

  <complextype name="submission">
    <sequence>
      <file-audit-data></file-audit-data>
      <submission-period-from-date>01/01/2014</submission-period-from-date>
      <submission-period-to-date>12/31/2014</submission-period-to-date>
      <aco-gpro></aco-gpro>
    </sequence>
    <attributeGroup ref="submissionAttributeGroup" />
  </complextype>

它根本不会进入每个人,请帮助我理解造成问题的原因......

1 个答案:

答案 0 :(得分:1)

你xsl:foreach在&#39; complextype&#39;节点,不在&#39;序列&#39;节点。试试这个:&#34;&lt; xsl:for-each select =&#34; // complextype [@name =&#39;提交&#39;] /序列&#34;&gt;&#34;