Handles opening elements of the xml file.
14082
public function startElement($name, $attributes)
    {
        try {
            if ($name == "dataset") {
                // Clear any start/end DLL
                call_user_func(array($this->builderClazz, 'reset'));
                $this->sqlWriter->write(call_user_func(array($this->builderClazz, 'getDatabaseStartSql')));
            } else {

                // we're processing a row of data
                // where tag name is phpName e.g. <BookReader .... />

                $table = $this->database->getTableByPhpName($name);

                $columnValues = array();
                foreach ($attributes as $name => $value) {
                    $col = $table->getColumnByPhpName($name);
                    $columnValues[] = new ColumnValue($col, iconv('utf-8', $this->encoding, $value));
                }

                $data = new DataRow($table, $columnValues);

                if ($this->currTableName !== $table->getName()) {
                    // new table encountered

                    if ($this->currBuilder !== null) {
                        $this->sqlWriter->write($this->currBuilder->getTableEndSql());
                    }

                    $this->currTableName = $table->getName();
                    $this->currBuilder = $this->generatorConfig->getConfiguredBuilder($table, 'datasql');

                    $this->sqlWriter->write($this->currBuilder->getTableStartSql());
                }

                // Write the SQL
                $this->sqlWriter->write($this->currBuilder->buildRowSql($data));
            }
        } catch (Exception $e) {
            // Exceptions have traditionally not bubbled up nicely from the expat parser,
            // so we also print the stack trace here.
            print $e;
            throw $e;
        }
    }
414077
def import_element(self, xml_element):
        

        self.xml_element = xml_element

        uri, tag = Element.get_namespace_and_tag(self.xml_element.tag)
        self.namespace = uri
        self.name = tag

        self.load_xml_attrs()

        if self.xml_element.text is None:
            self.text = ''
        else:
            self.text = self.xml_element.text
634918
public void parseString(String xml) throws ParserException {

        try {
            nanoElement.parseString(xml);
        } catch (XMLParseException e) {
            throw new ParserException(e.getMessage());
        }
    }
906621
private void processFile(String fileName)
      throws ValidationException, ParserConfigurationException, SAXException, IOException,
          SchedulerException, ClassNotFoundException, ParseException, XPathException {

    prepForProcessing();

    logger.info("Parsing XML file: " + fileName);
    InputSource is = new InputSource(getInputStream(fileName));
    // is.setSystemId(systemId);

    process(is);

    maybeThrowValidationException();
  }
1020594
static public void visitElements( XMLNode root, String path, ElementVisitor ev )
    {
        // Get last element in path
        int idx = path.lastIndexOf( '<' );
        String head = path.substring( 0, idx );
        String tag = path.substring( idx + 1, path.length() - 1 );

        XMLNode elem = findElementPath( root, head );
        if ( elem == null )
        {
            return;
        }

        // Iterate through all child nodes
        XMLNode n = elem.getNested();
        while ( n != null )
        {
            if ( n.isElement() && n.getName().equals( tag ) )
            {
                ev.visitElement( n );
            }
            n = n.getNext();
        }
    }
107695
function _tag_open( &$parser, $tag, $attributes ) {
		$this->currentElement = strtoupper( $tag );

		switch( $this->currentElement ) {
			case 'INDEX':
				if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
					$index = $this->addIndex( $attributes );
					xml_set_object( $parser,  $index );
				}
				break;
			case 'DATA':
				if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
					$data = $this->addData( $attributes );
					xml_set_object( $parser, $data );
				}
				break;
			case 'DROP':
				$this->drop();
				break;
			case 'FIELD':
				// Add a field
				$fieldName = $attributes['NAME'];
				$fieldType = $attributes['TYPE'];
				$fieldSize = isset( $attributes['SIZE'] ) ? $attributes['SIZE'] : NULL;
				$fieldOpts = !empty( $attributes['OPTS'] ) ? $attributes['OPTS'] : NULL;

				$this->addField( $fieldName, $fieldType, $fieldSize, $fieldOpts );
				break;
			case 'KEY':
			case 'NOTNULL':
			case 'AUTOINCREMENT':
			case 'DEFDATE':
			case 'DEFTIMESTAMP':
			case 'UNSIGNED':
				// Add a field option
				$this->addFieldOpt( $this->current_field, $this->currentElement );
				break;
			case 'DEFAULT':
				// Add a field option to the table object

				// Work around ADOdb datadict issue that misinterprets empty strings.
				if( $attributes['VALUE'] == '' ) {
					$attributes['VALUE'] = " '' ";
				}

				$this->addFieldOpt( $this->current_field, $this->currentElement, $attributes['VALUE'] );
				break;
			case 'OPT':
			case 'CONSTRAINT':
				// Accept platform-specific options
				$this->currentPlatform = ( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) );
				break;
			default:
				// print_r( array( $tag, $attributes ) );
		}
	}
741062
protected void open() {

        m_oldValue = m_selectionInput.m_textbox.getValue();
        CmsEmbeddedDialogHandler handler = new CmsEmbeddedDialogHandler();
        handler.setPrincipleSelectHandler(new I_CmsPrincipalSelectHandler() {

            public void selectPrincipal(String principal) {

                if (!getFormValue().equals(principal)) {
                    setFormValueAsString(principal);
                    fireValueChange(principal);
                }
            }
        });
        handler.openDialog(DIALOG_ID, null, null, m_configuration);
    }
464129
public void startElementContents(ElementBox elem)
    {
        //setup transformations for the contents
        AffineTransform at = Transform.createTransform(elem);
        if (at != null)
        {
            savedTransforms.put(elem, g.getTransform());
            g.transform(at);
        }
    }
1147167
public void openElementsInfo() {

        CmsResourceInfoDialog.load(
            CmsCoreProvider.get().getStructureId(),
            true,
            CmsContainerpageController.get().getData().getDetailId(),
            new HashMap<String, String>(),
            new CloseHandler<PopupPanel>() {

                public void onClose(CloseEvent<PopupPanel> event) {

                    deactivateCurrentButton();
                    activateSelection();
                }

            });
    }
406807
public static XElement parseXML(File file) throws XMLStreamException {
        try (InputStream in = new FileInputStream(file)) {
            return parseXML(in);
        } catch (IOException ex) {
            throw new XMLStreamException(ex);
        }
    }
609510
protected void parseImports() {
    List<Element> imports = rootElement.elements("import");
    for (Element theImport : imports) {
      String importType = theImport.attribute("importType");
      XMLImporter importer = this.getImporter(importType, theImport);
      if (importer == null) {
        addError("Could not import item of type " + importType, theImport);
      } else {
        importer.importFrom(theImport, this);
      }
    }
  }
1302849
def open(options={})
      f=IO.read(@destination + '/xl/workbook.xml')
      a=Ox::load(f)

      sheetdata(a, options); commentsrel; shstrings;

      @styles = Styles.new()
      File.open(@destination + '/xl/styles.xml', 'r') do |f|
        Ox.sax_parse(@styles, f)
      end

      @styles.temparray.sort_by!{|st| st[:numFmtId].to_i}
      add_custom_formats @styles.temparray
      @styles.styleary.map!{|s| Numformats::Formatarray[s.to_i][:id].to_i}
    end
1069585
def parse(self, xml_file, view_name=None) -> XmlNode:
        """"""
        self._setup_parser()
        try:
            self._view_name = view_name
            self._parser.ParseFile(xml_file)
        except ExpatError as error:
            # pylint: disable=E1101
            raise XmlError(errors.messages[error.code], ViewInfo(view_name, error.lineno))

        root = self._root
        self._reset()
        return root
460762
public function onDocumentStart()
    {
        $this->documentElement = new PHPTAL_Dom_Element('documentElement', 'http://xml.zope.org/namespaces/tal', array(), $this->getXmlnsState());
        $this->documentElement->setSource($this->file, $this->line);
        $this->_current = $this->documentElement;
    }
301468
@Override
    public void startElement(String uri, String localName, String name, Attributes attributes)
            throws SAXException {
        if ("table".equals(name)) {
            this.currentColumns = new LinkedHashMap<String, Column>();
            this.currentColumnTypes = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);
        } else if ("index".equals(name)) {
            this.currentIndex = new Index();
            this.currentIndex.setTable(this.currentTable);
        } else if ("unique".equals(name)) {
            this.currentUnique = new UniqueKey();
            this.currentUnique.setTable(this.currentTable);
        }

        this.chars = new StringBuilder();
    }
767708
private void openNextElementView() {

        List<CmsElementViewInfo> views = getData().getElementViews();
        if (views.size() > 1) {
            CmsUUID current = m_elementView.getRootViewId();

            // look for the current view index
            int currentIndex = -1;
            for (int i = 0; i < views.size(); i++) {
                CmsElementViewInfo view = views.get(i);
                if (view.isRoot() && current.equals(view.getElementViewId())) {
                    currentIndex = i;
                    break;
                }
            }
            if (currentIndex != -1) {
                CmsElementViewInfo target = null;
                // look for the next root view
                for (int i = currentIndex + 1; i < views.size(); i++) {
                    CmsElementViewInfo view = views.get(i);
                    if (view.isRoot()) {
                        target = view;
                        break;
                    }
                }
                if (target == null) {
                    // start at the beginning
                    for (int i = 0; i < currentIndex; i++) {
                        CmsElementViewInfo view = views.get(i);
                        if (view.isRoot()) {
                            target = view;
                            break;
                        }
                    }
                }
                if (target != null) {
                    final String viewName = target.getTitle();
                    Runnable action = new Runnable() {

                        public void run() {

                            CmsNotification.get().send(
                                Type.NORMAL,
                                Messages.get().key(Messages.GUI_SWITCH_ELEMENT_VIEW_NOTIFICATION_1, viewName));
                        }
                    };
                    setElementView(target, action);
                }
            }
        }
    }
816878
def open_files(self, idx=0):
        """"""
        self.elements.open_files(idx=idx)
        self.nodes.open_files(idx=idx)