魏长东

weichangdong

正在查看: 2017年04月日志归档(第 1 页 / 共 3 篇)

lua xml reader

xmlreader

自我感觉和PHP的xmlreader很像。

Provides the XmlReader interface. All functions may return nil plus an error message if LibXML2 reports an error.

  • lifecycle functions
  • methods that move the reader
  • iterators
  • others
  • extract information related to current node
  • extract information related to this reader instance

reader:read()

Moves the position of reader to the next node in the stream. Returns true if the node was read successfully, false if there are no more nodes to be read.

reader:read_inner_xml()

Reads the contents of the current node's child nodes, does not include the tags of the current node. Returns a string containing the XML content, or nil plus an error message if the current node is neither an element nor attribute, or has no child nodes.

reader:read_outer_xml()

Reads the contents of the current node, including child nodes and markup. Returns a string containing the XML content, or nil plus an error message if the current node is neither an element nor attribute, or has no child nodes.

reader:read_string()

Reads the contents of an element of a text node as a string. Returns a string or nil plus an error message if the reader is position on any other type of node.

reader:read_attribute_value()

Parses an attribute value into one or more Text and EntityReference nodes. Returns true in case of success, false if the reader was not positioned on an attribute node or all the attribute value have been read.

»»阅读全文

开发利器

nc 发送请求到指定端口
netstat /tcpdump 查看网络请求

strace 调试程序,可以看见程序每一步的输出之类的。

另外发现了一个 Linux比较好的工具 inotify-tools。我本地mac也装了一个类似的,但是没有linux下的好。
图片处理 mac装了 gm  convert  和convert  感觉好牛逼啊 。很好用。

境界

当你看别人的博客写的东西,你自己都会的时候,说明你的技术已经提升了一个台阶。