Query-Oriented Model for XML 0.1 Alpha1
|
|||||||||||||||||||
Query-Oriented Model for XML is a lightweight XML processing framework for Java that promotes the use of XPath instead of Java code for consuming XML.
The resulting code from Query-Oriented Model for XML, is simple and expressive with no meaningless objects and no meaningless parameters - just pure business code.
Here's a sample of usage (from a testcase -- here's the used XML document):
public class BigTest extends TestCase {
public static final String[] CONTEXT = {"c urn:catalog", "n urn:name"};
@QUseContext("CONTEXT") // Use the namespace context specified by the CONTEXT field.
public void test() {
InputStream xml = QomTestResources.getTestXml("catalog.xml"); // Get the source.
QLocation root = new QBuilder().build(xml); // Build the root location.
// Test a deep query.
Assert.assertEquals("Harold", root.value("//c:maintainer/n:name[n:first_name = 'Elliotte']/n:last_name"));
QLocation[] composers = root.locateAll("c:composer"); // Test a multi-query.
Assert.assertEquals(4, composers.length);
String[] names = {"Julie", "Margaret", "Beth", "Linda"};
for (int i = 0; i < composers.length; ++i) {
Assert.assertEquals(names[i], composers[i].value("n:name/n:first_name")); // Test relative queries.
}
}
}
tags
Download Query-Oriented Model for XML 0.1 Alpha1
Authors software
Similar software
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other software in this category
|
|
|
|
|
|
|
|
Featured Software
jEdit 4.3 pre8
jEdit is an Open Source text editor written in Java
Opera 9.02
Surf the Internet in a safer, faster, and easier way with Opera browser
GNU Aspell 0.60.4
GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell
- Communications
- Database
- Desktop Environment
- Games
- Internet
- Multimedia
- Office
- Programming
- Science and Engineering
- System
- Text Editing&Processing
