Sitemap Entry Counter
Count direct entries in a balanced XML sitemap or sitemap index with the standard namespace, rejecting DTDs and nested namespace rebinding.
Description
A sitemap lists resource entries, while a sitemap index lists other sitemap documents.
A sitemap lists resource entries, while a sitemap index lists other sitemap documents. Counting direct entries distinguishes those two document kinds without following their links.1
Count direct entries in a balanced XML sitemap or sitemap index with the standard namespace, rejecting DTDs and nested namespace rebinding.
When to use Sitemap Entry Counter
Use this tool to count direct entries in a balanced XML sitemap or sitemap index with the standard namespace, rejecting DTDs and nested namespace rebinding.
Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
How to use Sitemap Entry Counter and understand its results
- Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
- Enter xml using the field table and calculation rules, then run the tool.
- Read urls, sitemaps, kind. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| xml | Sitemap XML source. | string; maximum length: 1000000 | Required |
Paste XML using the standard sitemap namespace and a urlset or sitemapindex root. The scanner verifies matched tags and a single root, recognizes quoted attributes, comments, processing instructions and internal CDATA, then counts direct entries using the root prefix. Return kind plus URL and sitemap counts.
count direct root children named url or sitemap in the standard sitemap namespace Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| urls | Direct URL entries. | integer; minimum: 0 |
| sitemaps | Direct sitemap entries. | integer; minimum: 0 |
| kind | Sitemap document kind. | string; one of "urlset", "sitemapindex" |
{
"input": {
"xml": "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><url><loc>https://example.com/</loc></url><url><loc>https://example.com/about</loc></url></urlset>"
},
"output": {
"urls": 2,
"sitemaps": 0,
"kind": "urlset"
}
} Limitations and assumptions
DTDs and nested namespace declarations/rebinding are rejected. This is not full XML or sitemap schema validation: loc content, duplicates and URL validity are not checked, and linked sitemaps are not fetched.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use Canonical Link Extractor: Extract canonical-link href values from HTML source, preserving source order and resolving no URLs implicitly. For a complementary task, use URL Hostname: Extract the hostname of an absolute URL using the WHATWG URL parser, including its normalization rules.
References
-
Sitemap Entry Counter — tool.io
Similar or alternative tools
- Canonical Link Extractor
Extract canonical-link href values from HTML source, preserving source order and resolving no URLs implicitly.
- URL Hostname
Extract the hostname of an absolute URL using the WHATWG URL parser, including its normalization rules.