0.0.2 • Published 9 years ago

xml2xpath v0.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

xsd2xpath

Generate list of possible XPaths based on XSD or XML

Usage

XSD

To parse XSD, you need

var xpathParser = require('xml2xpath');

xpathParser.parseXsd('example.xsd', function(xpaths) {
	console.log(xpaths.join('\n'));		
});

will generate:

header                                 
header/fiscalYear                      
header/startDate                       
header/endDate                         
...

XML

To parse XML, you need

var xpathParser = require('xml2xpath');

xpathParser.parseXml('books.xml', function(xpaths) {
	console.log(xpaths.join('\n'));		
});

will generate:

catalog                    
catalog/book               
catalog/book/author        
catalog/book/title         
catalog/book/genre         
catalog/book/price         
catalog/book/publish_date  
catalog/book/description