douwen7603 2009-02-04 23:03
浏览 44

PHP XMLReader获取父节点?

While parsing an XML File using the XMLReader Method, how do I get the parent node of an element ?

$xml = new XMLReader();
$xml->XML($xmlString);
while($xml->read())
{

$xml->localName; // gives tag name
$xml->value; // gives tag value

// how do I access the parent of this element 
}
  • 写回答

3条回答 默认 最新

  • dook0034 2009-02-04 23:07
    关注

    I think you want: XMLReader::moveToElement

    评论

报告相同问题?