定制 olcaytaner/xmlparser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

olcaytaner/xmlparser

最新稳定版本:1.0.1

Composer 安装命令:

composer require olcaytaner/xmlparser

包简介

Simple Xml Parser

README 文档

README

You can also see C++, C, Js, or Java repository.

Requirements

Php

To check if you have a compatible version of Php installed, use the following command:

php -V

You can find the latest version of Php here.

Git

Install the latest version of Git.

Download Code

In order to work on code, create a fork from GitHub page. Use Git for cloning the code to your local or below line for Ubuntu:

git clone <your-fork-git-link>

A directory called XmlParser will be created. Or you can use below link for exploring the code:

git clone https://github.com/starlangsoftware/XmlParser-Php.git

Open project with PhpStorm IDE

Steps for opening the cloned project:

  • Start IDE
  • Select File | Open from main menu
  • Choose XmlParser-Php file
  • Select open as project option
  • Couple of seconds, dependencies will be downloaded.

Detailed Description

In order to load an xml document, we use the constructor

$doc = new XmlDocument($fileName)

and parse with the parse method

$doc->parse()

Root node of the document can be obtained via the getFirstChild method:

$rootNode = $doc->getFirstChild()

For example, to iterate over the first level tags in the xml file one can use

$rootNode = $doc->getFirstChild()
$childNode = $rootNode->getFirstChild()
while ($childNode){
  ...
  $childNode = $childNode->getNextSibling()
}

Tag name can be obtained via getName, pcData via getPcData methods.

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 8
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2024-11-15