MCPcopy Index your code
hub / github.com/XmirrorSecurity/OpenSCA-cli / isName

Function isName

opensca/sca/java/xml/xml.go:1228–1250  ·  view source on GitHub ↗
(s []byte)

Source from the content-addressed store, hash-verified

1226}
1227
1228func isName(s []byte) bool {
1229 if len(s) == 0 {
1230 return false
1231 }
1232 c, n := utf8.DecodeRune(s)
1233 if c == utf8.RuneError && n == 1 {
1234 return false
1235 }
1236 if !unicode.Is(first, c) {
1237 return false
1238 }
1239 for n < len(s) {
1240 s = s[n:]
1241 c, n = utf8.DecodeRune(s)
1242 if c == utf8.RuneError && n == 1 {
1243 return false
1244 }
1245 if !unicode.Is(first, c) && !unicode.Is(second, c) {
1246 return false
1247 }
1248 }
1249 return true
1250}
1251
1252func isNameString(s string) bool {
1253 if len(s) == 0 {

Callers 3

textMethod · 0.85
nameMethod · 0.85
createAttrPrefixMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected