Skip to content
Novus Examples
xml960 B

Android strings.xml — English

An Android values/strings.xml (English) with string resources, a <plurals> block, and a <string-array>, using positional %1$s placeholders — the res/values/ default catalog.

Preview — first 28 linesxml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Novus Example</string>
    <!-- Greeting shown on the home screen -->
    <string name="greeting">Hello</string>
    <!-- Welcome message with the user's name -->
    <string name="welcome">Welcome, %1$s</string>
    <!-- Save button label -->
    <string name="save">Save</string>
    <!-- Cancel button label -->
    <string name="cancel">Cancel</string>
    <!-- Search field placeholder -->
    <string name="search">Search</string>
    <!-- Settings menu item -->
    <string name="settings">Settings</string>
    <!-- Log out menu item -->
    <string name="logout">Log out</string>
    <plurals name="items_count">
        <item quantity="one">%d item</item>
        <item quantity="other">%d items</item>
    </plurals>
    <string-array name="sections">
        <item>Home</item>
        <item>Profile</item>
        <item>Settings</item>
    </string-array>
</resources>

Specifications

Format
Android resources
Language
en (values/)
Features
string, plurals, string-array
Placeholder
%1$s

What is a .xml file?

XML (Extensible Markup Language) is a verbose, self-describing markup language using nested tags, attributes, and namespaces to represent structured, hierarchical data. It supports schemas, entities, and validation and underlies many document and data formats. It remains common in enterprise, publishing, and interchange contexts.

How to use this file

Use an example XML file to test parsers, namespace and schema validation, XPath queries, and protection against entity-expansion and external-entity attacks.

Code examples

import xml.etree.ElementTree as ET

tree = ET.parse("strings.xml")
root = tree.getroot()
print(root.tag, [c.tag for c in root][:5])

Generated by generation/localization.py. Free for any use, no attribution required — license.