MCPcopy Create free account
hub / github.com/XmirrorSecurity/OpenSCA-cli / isNameString

Function isNameString

opensca/sca/java/xml/xml.go:1252–1274  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

1250}
1251
1252func isNameString(s string) bool {
1253 if len(s) == 0 {
1254 return false
1255 }
1256 c, n := utf8.DecodeRuneInString(s)
1257 if c == utf8.RuneError && n == 1 {
1258 return false
1259 }
1260 if !unicode.Is(first, c) {
1261 return false
1262 }
1263 for n < len(s) {
1264 s = s[n:]
1265 c, n = utf8.DecodeRuneInString(s)
1266 if c == utf8.RuneError && n == 1 {
1267 return false
1268 }
1269 if !unicode.Is(first, c) && !unicode.Is(second, c) {
1270 return false
1271 }
1272 }
1273 return true
1274}
1275
1276// These tables were generated by cut and paste from Appendix B of
1277// the XML spec at https://www.xml.com/axml/testaxml.htm

Callers 1

EncodeTokenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected