34 chars · 1 line
Waiting for input
34 chars · 1 line
Waiting for input
XML attribute troubleshooting
The sample assigns port twice on the same service element. XML attributes on one element need unique names, so the parser rejects the start tag rather than choosing one value automatically. This tool is free to use. No account or payment is required.
Last updated
Silently keeping the first or last value would make the document ambiguous. Well-formedness therefore requires attribute names to be unique within each start tag.
If an element genuinely needs multiple values of the same kind, repeated child elements or another schema-defined collection often represent that data more clearly than duplicate attributes.
Keep one authoritative port attribute on the service element.
<service port="8080" port="9090"/><service port="8080"/>Common questions
No. Attribute names must be unique within a single element start tag.
Yes. The uniqueness rule applies within each individual element, not across the entire document.
A well-formed XML parser should reject the document instead of selecting one duplicate value.
Debugging a specific XML issue? Browse XML troubleshooting.