branches: front
Clone
clone: git://shithub.us/sirjofri/xml-9atom gits://shithub.us/sirjofri/xml-9atom
push: hjgit://shithub.us/sirjofri/xml-9atom
Last commit
4e09200f
– sirjofri <
[email protected]>
authored
on 2024/08/02 09:19
adds libxml support for processing instructions and comments
About
xml tools from 9atom as archived from
https://github.com/Plan9-Archive/9atom
plug-in repository for the following xml tools:
- libxml:
/sys/include/xml.h
/$objtype/lib/libxml.a
/sys/man/2/xml
- xb:
/$objtype/bin/xb
/sys/man/1/xb
- libxpath: (not from 9atom)
/sys/include/xpath.h
/$objtype/lib/libxpath.a
/sys/man/2/xpath
Installation:
mk install
mk clean (optional)
Deinstallation:
mk nuke
This will remove all the installed files.
Libxml
This version of libxml adds support for the following features.
To get a good overview of how these features work, check the man page.
- Namespace support for Elems and Attrs, which supersedes Fstripnamespace
- Processing instructions are Elems which names start with '?'
- Comments are now full nodes with their name set to nil and pcdata is the comment
Caution: The introduction of processing instructions and comment nodes can lead to weird behaviour with illegal XML files, like ones containing things like <?procinst/> and <?procinst></procinst>.
Libxpath
currently supported rules:
- root path: /path/from/root
- functions: text(), position(), last(), node()
- filter/predicates: /path/to[path=path]
- full path support: [path/to/@attr='hello']
- type-safe: num==num, string==string, node==node
- node types:
- name (/path)
- string (/'hello')
- number (/2)
- function (/func())
- numbered element: /path/to/second[2]/element
- stepping:
- /absolute/paths and relative/paths
- descendant-or-self:: and //
- child:: and x/y
- attribute:: and @attr
There are probably bugs.