xpath_selector_xml_parser 3.0.1 copy "xpath_selector_xml_parser: ^3.0.1" to clipboard
xpath_selector_xml_parser: ^3.0.1 copied to clipboard

A xml parser implementation with xml for xpath_selector, xpath_selector is required.

example/example.dart

import 'package:xml/xml.dart';
import 'package:xpath_selector_xml_parser/xpath_selector_xml_parser.dart';

final input = '''
<bookstore xmlns:h="https://test.z31.ink" xmlns:t="https://test.z31.ink/sub">
    <book category="children">
        <title lang="en">Harry Potter</title>
        <author>J K. Rowling</author>
        <year>2005</year>
        <price>29.99</price>
    </book>
    <book category="cooking">
        <title lang="en">Everyday Italian</title>
        <author>Giada De Laurentiis</author>
        <year>2005</year>
        <price>30.00</price>
    </book>
    <book category="web" cover="paperback">
        <title lang="en">Learning XML</title>
        <author>Erik T. Ray</author>
        <year>2003</year>
        <price>39.95</price>
    </book>
    <book category="web">
        <title lang="en">XQuery Kick Start</title>
        <author>James McGovern</author>
        <author>Per Bothner</author>
        <author>Kurt Cagle</author>
        <author>James Linn</author>
        <author>Vaidyanathan Nagarajan</author>
        <year>2003</year>
        <price>49.99</price>
    </book>
</bookstore>
''';

void main() {
  final xml1 = XmlDocument.parse(input);
  final xml2 = XmlXPath.node(xml1);
  final xml3 = XmlXPath.xml(input);

  print(xml1.queryXPath('//book'));
  print(xml2.query('//book/title'));
  print(xml3.query('//*[@lang="en"]'));
}
1
likes
150
points
560
downloads

Publisher

verified publisherz31.ink

Weekly Downloads

A xml parser implementation with xml for xpath_selector, xpath_selector is required.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

xml, xpath_selector

More

Packages that depend on xpath_selector_xml_parser