A range of characters.
The character represented by the predefined entity reference that was parsed from the front of the given range or null if the range did not start with one of the five predefined entity references.
{ auto range = "&foo"; assert(range.parseStdEntityRef() == '&'); assert(range == "foo"); } { auto range = ">bar"; assert(range.parseStdEntityRef() == '>'); assert(range == "bar"); } { auto range = "<baz"; assert(range.parseStdEntityRef() == '<'); assert(range == "baz"); } { auto range = "'dlang"; assert(range.parseStdEntityRef() == '\''); assert(range == "dlang"); } { auto range = ""rocks"; assert(range.parseStdEntityRef() == '"'); assert(range == "rocks"); } { auto range = " &foo"; assert(range.parseStdEntityRef().isNull); assert(range == " &foo"); } { auto range = "&Amp;hello"; assert(range.parseStdEntityRef().isNull); assert(range == "&Amp;hello"); } { auto range = " foo"; assert(range.parseStdEntityRef().isNull); assert(range == " foo"); } { auto range = "hello world"; assert(range.parseStdEntityRef().isNull); assert(range == "hello world"); }
This parses one of the five, predefined entity references mention in the XML spec from the front of a range of characters.
If the given range starts with one of the five, predefined entity references, then it is removed from the range, and the corresponding character is returned.
If the range does not start with one of those references, then the return value is null, and the range is unchanged.
Any other entity references would require processing a DTD section in order to be handled and are untouched by parseStdEntityRef as are any other types of references.