PHP Classes

LOM: Extract information from XML documents

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 56 All time: 10,217 This week: 423Up
Version License PHP version Categories
lom 0.2Freeware5XML, PHP 5, Parsers
Description Author

This package can extract information from XML documents.

It can parse a given XML file and perform queries to extract data from certain tags.

The query expressions syntax allow to specify values to match tag attribute names.

Picture of Jill Lingoff
Name: Jill Lingoff <contact>
Classes: 3 packages by
Country: France France
Innovation award
Innovation award
Nominee: 1x

Details

LOM

Version 0.2

If you are manipulating XML with PHP then this is the code you want. LOM used to use array-based internal data structure but now uses string-based internal data structure. With this type of optimization it's about 10 times faster. Another improvement is that the external data structure (that which is accesible as the results of queries) is now the more familiar (to users of PHP regular expressions) string-offset pairs.

See test.php for usage examples.

To see an example of what's possible with LOM, check out a game made using it:

http://flaurora-sonora.000webhostapp.com/infini/bbalof.php?scenario=0

Version 0.1

LOM is an XML querying language; or slang, if you prefer. In terms of other querying languages: this one would be said to use a dynamic, rather than static, context. So query results depend on code-wise previous query results. Basically, it allows a coder to write code more lazily by having LOM assume that something not very specifically referenced should be looked for within the most relevant contexts (usually the most recent ones). This pushes it a little towards being conversational rather than only logical. An example will probably clarify things:

Sarah: I want lots of friends. Do you have many friends?<br> Jill: I have some but my brother has more.<br> Sarah: Oh yeah, my brother has lots of friends too.<br> Jill: What are their names?<br>

Based on the above conversation, we can probably see that what we are interested in would be the names of Sarah's brother's friends and not the names of Jill's friends or the names of all the friends Sarah and Jill know or the names of everything in the universe. LOM makes the syntax for this query simple; it would be $O->_('name'); assuming that the rest of the conversation were similarly coded.

See test.php for usage examples.

  Files folder image Files  
File Role Description
Plain text file O.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file test.php Example Example script
Accessible without login Plain text file test.xml Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:56
This week:0
All time:10,217
This week:423Up
For more information send a message to info at phpclasses dot org.