From 83c60064e45293a90fee9a5687acac7ac206e101 Mon Sep 17 00:00:00 2001 From: Torsten Bergmann Date: Thu, 26 Oct 2023 00:26:56 +0200 Subject: [PATCH] Simplify DTDAttributeDefinitionParser class>>#attributeDefaultValidatorClassForPragma: Fix #24 --- src/XML-Parser/DTDAttributeDefinitionParser.class.st | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/XML-Parser/DTDAttributeDefinitionParser.class.st b/src/XML-Parser/DTDAttributeDefinitionParser.class.st index 3886a736..c1525364 100644 --- a/src/XML-Parser/DTDAttributeDefinitionParser.class.st +++ b/src/XML-Parser/DTDAttributeDefinitionParser.class.st @@ -18,11 +18,10 @@ Class { DTDAttributeDefinitionParser class >> attributeDefaultValidatorClassForPragma: aDefaultPragma [ "the default pragma should have been checked for well-formedness by the tokenizer so it's either empty, 'FIXED', 'REQUIRED', or 'IMPLIED'" - aDefaultPragma size > 0 - ifTrue: [ - (aDefaultPragma at: 1) == $F + aDefaultPragma ifNotEmpty: [ + aDefaultPragma first == $F ifTrue: [^ XMLAttributeFixedValueDefaultValidator]. - (aDefaultPragma at: 1) == $I + aDefaultPragma first == $I ifTrue: [^ XMLAttributeImpliedDefaultValidator]. ^ XMLAttributeRequiredDefaultValidator]. ^ XMLAttributeValueDefaultValidator