Ejemplo n.º 1
0
    /*foreach( $matches as $match ) {
        echo "Found match: " . $match[0];
        //var_export( $match );
        echo "\n";
      }*/
} else {
    echo "Error finding structs!\n";
}
var_export($reg_info);
// Finally write the register info to an XML sheet
$xmlWriter = new XMLWriter();
//$xmlWriter->openMemory();
$xmlWriter->openURI($OUTPUT_FILE);
$xmlWriter->setIndent(true);
$xmlWriter->startDocument("1.0", "UTF-8");
$xmlWriter->writeDTD("model", NULL, "embsysregview.dtd");
$xmlWriter->startElement("model");
$xmlWriter->writeAttribute("chipname", $CHIPNAME);
$xmlWriter->writeElement("chip_description", $CHIPDESCRIPTION);
foreach ($reg_info as $group => $reg_groups) {
    $xmlWriter->startElement("group");
    $xmlWriter->writeAttribute("name", $group);
    $xmlWriter->writeAttribute("description", "");
    foreach ($reg_groups as $reg_group => $reg_group_members) {
        $xmlWriter->startElement("registergroup");
        $xmlWriter->writeAttribute("name", $reg_group);
        $xmlWriter->writeAttribute("description", "");
        foreach ($reg_group_members as $reg_member) {
            $xmlWriter->startElement("register");
            foreach ($reg_member as $reg_member_info => $reg_member_value) {
                $xmlWriter->writeAttribute($reg_member_info, $reg_member_value);