sitemap_processor 1.0.1 copy "sitemap_processor: ^1.0.1" to clipboard
sitemap_processor: ^1.0.1 copied to clipboard

Sitemap processor Dart package, useful to parse XML with sitemaps and sitemap indexes into more manageable objects.

example/example.dart

import 'package:sitemap_processor/sitemap_processor.dart';

void main() {
  // Initialize SitemapProcessor
  final SitemapProcessor processor = SitemapProcessor();

  // Process a sitemap index
  SitemapIndex sitemapIndex = processor.process(
      '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>http://www.example.com/sitemap1.xml.gz</loc></sitemap></sitemapindex>');
  print(sitemapIndex.sitemapindex.sitemap[0].loc);

  // Process a sitemap
  Sitemap sitemap = processor.process(
      '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>http://www.example.com/</loc></url></urlset>');
  print(sitemap.urlset.url[0].loc);
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Sitemap processor Dart package, useful to parse XML with sitemaps and sitemap indexes into more manageable objects.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, json_annotation, xml2json

More

Packages that depend on sitemap_processor