XFA: generate attribute tables via C Preprocessor.

Keep several tables in sync with each other before we even
consider adding missing attribute values. Also allows testing
that the hash values are legitimate.

Remove one explicit call to ByteStringView() along the way as
native types are expected to promote implicitly to these.

Change-Id: I24e88d84e5907e43a8c946063b5715dd67cbc422
Reviewed-on: https://pdfium-review.googlesource.com/c/46670
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fxfa/BUILD.gn b/xfa/fxfa/BUILD.gn
index 0c44f6b..ae8679f 100644
--- a/xfa/fxfa/BUILD.gn
+++ b/xfa/fxfa/BUILD.gn
@@ -134,6 +134,7 @@
   sources = [
     "cxfa_ffbarcode_unittest.cpp",
     "cxfa_textparser_unittest.cpp",
+    "fxfa_basic_unittest.cpp",
   ]
   deps = [
     ":fxfa",
diff --git a/xfa/fxfa/fxfa_basic.h b/xfa/fxfa/fxfa_basic.h
index e25ef7c..9198caa 100644
--- a/xfa/fxfa/fxfa_basic.h
+++ b/xfa/fxfa/fxfa_basic.h
@@ -365,251 +365,15 @@
 };
 
 enum class XFA_Attribute : uint8_t {
-  H = 0,
-  W,
-  X,
-  Y,
-  Id,
-  To,
-  LineThrough,
-  HAlign,
-  Typeface,
-  BeforeTarget,
-  Name,
-  Next,
-  DataRowCount,
-  Break,
-  VScrollPolicy,
-  FontHorizontalScale,
-  TextIndent,
-  Context,
-  TrayOut,
-  Cap,
-  Max,
-  Min,
-  Ref,
-  Rid,
-  Url,
-  Use,
-  LeftInset,
-  Widows,
-  Level,
-  BottomInset,
-  OverflowTarget,
-  AllowMacro,
-  PagePosition,
-  ColumnWidths,
-  OverflowLeader,
-  Action,
-  NonRepudiation,
-  Rate,
-  AllowRichText,
-  Role,
-  OverflowTrailer,
-  Operation,
-  Timeout,
-  TopInset,
-  Access,
-  CommandType,
-  Format,
-  DataPrep,
-  WidgetData,
-  Abbr,
-  MarginRight,
-  DataDescription,
-  EncipherOnly,
-  KerningMode,
-  Rotate,
-  WordCharacterCount,
-  Type,
-  Reserve,
-  TextLocation,
-  Priority,
-  Underline,
-  ModuleWidth,
-  Hyphenate,
-  Listen,
-  Delimiter,
-  ContentType,
-  StartNew,
-  EofAction,
-  AllowNeutral,
-  Connection,
-  BaselineShift,
-  OverlinePeriod,
-  FracDigits,
-  Orientation,
-  TimeStamp,
-  PrintCheckDigit,
-  MarginLeft,
-  Stroke,
-  ModuleHeight,
-  TransferEncoding,
-  Usage,
-  Presence,
-  RadixOffset,
-  Preserve,
-  AliasNode,
-  MultiLine,
-  Version,
-  StartChar,
-  ScriptTest,
-  StartAngle,
-  CursorType,
-  DigitalSignature,
-  CodeType,
-  Output,
-  BookendTrailer,
-  ImagingBBox,
-  ExcludeInitialCap,
-  Force,
-  CrlSign,
-  Previous,
-  PushCharacterCount,
-  NullTest,
-  RunAt,
-  SpaceBelow,
-  SweepAngle,
-  NumberOfCells,
-  LetterSpacing,
-  LockType,
-  PasswordChar,
-  VAlign,
-  SourceBelow,
-  Inverted,
-  Mark,
-  MaxH,
-  MaxW,
-  Truncate,
-  MinH,
-  MinW,
-  Initial,
-  Mode,
-  Layout,
-  Server,
-  EmbedPDF,
-  OddOrEven,
-  TabDefault,
-  Contains,
-  RightInset,
-  MaxChars,
-  Open,
-  Relation,
-  WideNarrowRatio,
-  Relevant,
-  SignatureType,
-  LineThroughPeriod,
-  Shape,
-  TabStops,
-  OutputBelow,
-  Short,
-  FontVerticalScale,
-  Thickness,
-  CommitOn,
-  RemainCharacterCount,
-  KeyAgreement,
-  ErrorCorrectionLevel,
-  UpsMode,
-  MergeMode,
-  Circular,
-  PsName,
-  Trailer,
-  UnicodeRange,
-  ExecuteType,
-  DuplexImposition,
-  TrayIn,
-  BindingNode,
-  BofAction,
-  Save,
-  TargetType,
-  KeyEncipherment,
-  CredentialServerPolicy,
-  Size,
-  InitialNumber,
-  Slope,
-  CSpace,
-  ColSpan,
-  Binding,
-  Checksum,
-  CharEncoding,
-  Bind,
-  TextEntry,
-  Archive,
-  Uuid,
-  Posture,
-  After,
-  Orphans,
-  QualifiedName,
-  Usehref,
-  Locale,
-  Weight,
-  UnderlinePeriod,
-  Data,
-  Desc,
-  Numbered,
-  DataColumnCount,
-  Overline,
-  UrlPolicy,
-  AnchorType,
-  LabelRef,
-  BookendLeader,
-  MaxLength,
-  AccessKey,
-  CursorLocation,
-  DelayedOpen,
-  Target,
-  DataEncipherment,
-  AfterTarget,
-  Leader,
-  Picker,
-  From,
-  BaseProfile,
-  Aspect,
-  RowColumnRatio,
-  LineHeight,
-  Highlight,
-  ValueRef,
-  MaxEntries,
-  DataLength,
-  Activity,
-  Input,
-  Value,
-  BlankOrNotBlank,
-  AddRevocationInfo,
-  GenericFamily,
-  Hand,
-  Href,
-  TextEncoding,
-  LeadDigits,
-  Permissions,
-  SpaceAbove,
-  CodeBase,
-  Stock,
-  IsNull,
-  RestoreState,
-  ExcludeAllCaps,
-  FormatTest,
-  HScrollPolicy,
-  Join,
-  KeyCertSign,
-  Radius,
-  SourceAbove,
-  Override,
-  ClassId,
-  Disable,
-  Scope,
-  Match,
-  Placement,
-  Before,
-  WritingScript,
-  EndChar,
-  Lock,
-  Long,
-  Intact,
-  XdpContent,
-  DecipherOnly,
+#undef ATTR____
+#define ATTR____(a, b, c) c,
+#include "xfa/fxfa/parser/attributes.inc"
+#undef ATTR____
+  FIRST_UNUSED,
   Unknown = 255,
 };
+static_assert(XFA_Attribute::FIRST_UNUSED < XFA_Attribute::Unknown,
+              "enumerated value collsion");
 
 enum class XFA_Element : int16_t {
   Unknown = -1,
diff --git a/xfa/fxfa/fxfa_basic_unittest.cpp b/xfa/fxfa/fxfa_basic_unittest.cpp
new file mode 100644
index 0000000..e4da266
--- /dev/null
+++ b/xfa/fxfa/fxfa_basic_unittest.cpp
@@ -0,0 +1,25 @@
+// Copyright 2018 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "xfa/fxfa/fxfa_basic.h"
+
+#include "core/fxcrt/bytestring.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(FXFABasic, HashMatchesString) {
+#undef ATTR____
+#define ATTR____(a, b, c) EXPECT_EQ(a, FX_HashCode_GetAsIfW(b, false));
+#include "xfa/fxfa/parser/attributes.inc"
+#undef ATTR____
+}
+
+TEST(FXFABasic, HashOrder) {
+  uint32_t so_far = 0;
+#undef ATTR____
+#define ATTR____(a, b, c) \
+  EXPECT_LT(so_far, a);   \
+  so_far = a;
+#include "xfa/fxfa/parser/attributes.inc"
+#undef ATTR____
+}
diff --git a/xfa/fxfa/parser/attributes.inc b/xfa/fxfa/parser/attributes.inc
new file mode 100644
index 0000000..6f4504f
--- /dev/null
+++ b/xfa/fxfa/parser/attributes.inc
@@ -0,0 +1,249 @@
+// Copyright 2018 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+ATTR____(0x00000068u, "h", H)
+ATTR____(0x00000077u, "w", W)
+ATTR____(0x00000078u, "x", X)
+ATTR____(0x00000079u, "y", Y)
+ATTR____(0x00021aedu, "id", Id)
+ATTR____(0x00025363u, "to", To)
+ATTR____(0x00cb0ac9u, "lineThrough", LineThrough)
+ATTR____(0x02282c73u, "hAlign", HAlign)
+ATTR____(0x02c1c7f1u, "typeface", Typeface)
+ATTR____(0x03106c3au, "beforeTarget", BeforeTarget)
+ATTR____(0x031b19c1u, "name", Name)
+ATTR____(0x03848b3fu, "next", Next)
+ATTR____(0x043e349bu, "dataRowCount", DataRowCount)
+ATTR____(0x05518c25u, "break", Break)
+ATTR____(0x05ce6195u, "vScrollPolicy", VScrollPolicy)
+ATTR____(0x08c74ae9u, "fontHorizontalScale", FontHorizontalScale)
+ATTR____(0x08d4f1c7u, "textIndent", TextIndent)
+ATTR____(0x097c1c65u, "context", Context)
+ATTR____(0x09876578u, "trayOut", TrayOut)
+ATTR____(0x0a2e3514u, "cap", Cap)
+ATTR____(0x0b3543a6u, "max", Max)
+ATTR____(0x0b356ca4u, "min", Min)
+ATTR____(0x0bb8df5du, "ref", Ref)
+ATTR____(0x0bb8f3dfu, "rid", Rid)
+ATTR____(0x0c080cd3u, "url", Url)
+ATTR____(0x0c0811edu, "use", Use)
+ATTR____(0x0cfea02eu, "leftInset", LeftInset)
+ATTR____(0x1026c59du, "widows", Widows)
+ATTR____(0x1059ec18u, "level", Level)
+ATTR____(0x1356caf8u, "bottomInset", BottomInset)
+ATTR____(0x13a08bdbu, "overflowTarget", OverflowTarget)
+ATTR____(0x1414d431u, "allowMacro", AllowMacro)
+ATTR____(0x14a32d52u, "pagePosition", PagePosition)
+ATTR____(0x1517dfa1u, "columnWidths", ColumnWidths)
+ATTR____(0x169134a1u, "overflowLeader", OverflowLeader)
+ATTR____(0x1b8dce3eu, "action", Action)
+ATTR____(0x1e459b8fu, "nonRepudiation", NonRepudiation)
+ATTR____(0x1ec8ab2cu, "rate", Rate)
+ATTR____(0x1ef3a64au, "allowRichText", AllowRichText)
+ATTR____(0x2038c9b2u, "role", Role)
+ATTR____(0x20914367u, "overflowTrailer", OverflowTrailer)
+ATTR____(0x226ca8f1u, "operation", Operation)
+ATTR____(0x24d85167u, "timeout", Timeout)
+ATTR____(0x25764436u, "topInset", TopInset)
+ATTR____(0x25839852u, "access", Access)
+ATTR____(0x268b7ec1u, "commandType", CommandType)
+ATTR____(0x28dee6e9u, "format", Format)
+ATTR____(0x28e17e91u, "dataPrep", DataPrep)
+ATTR____(0x292b88feu, "widgetData", WidgetData)
+ATTR____(0x29418bb7u, "abbr", Abbr)
+ATTR____(0x2a82d99cu, "marginRight", MarginRight)
+ATTR____(0x2b5df51eu, "dataDescription", DataDescription)
+ATTR____(0x2bb3f470u, "encipherOnly", EncipherOnly)
+ATTR____(0x2cd79033u, "kerningMode", KerningMode)
+ATTR____(0x2ee7678fu, "rotate", Rotate)
+ATTR____(0x2f105f72u, "wordCharacterCount", WordCharacterCount)
+ATTR____(0x2f16a382u, "type", Type)
+ATTR____(0x34ae103cu, "reserve", Reserve)
+ATTR____(0x3650557eu, "textLocation", TextLocation)
+ATTR____(0x39cdb0a2u, "priority", Priority)
+ATTR____(0x3a0273a6u, "underline", Underline)
+ATTR____(0x3b582286u, "moduleWidth", ModuleWidth)
+ATTR____(0x3d123c26u, "hyphenate", Hyphenate)
+ATTR____(0x3e7af94fu, "listen", Listen)
+ATTR____(0x4156ee3fu, "delimiter", Delimiter)
+ATTR____(0x42fed1fdu, "contentType", ContentType)
+ATTR____(0x453eaf38u, "startNew", StartNew)
+ATTR____(0x45a6daf8u, "eofAction", EofAction)
+ATTR____(0x47cfa43au, "allowNeutral", AllowNeutral)
+ATTR____(0x47d03490u, "connection", Connection)
+ATTR____(0x4873c601u, "baselineShift", BaselineShift)
+ATTR____(0x4b319767u, "overlinePeriod", OverlinePeriod)
+ATTR____(0x4b8bc840u, "fracDigits", FracDigits)
+ATTR____(0x4ef3d02cu, "orientation", Orientation)
+ATTR____(0x4fdc3454u, "timeStamp", TimeStamp)
+ATTR____(0x52666f1cu, "printCheckDigit", PrintCheckDigit)
+ATTR____(0x534729c9u, "marginLeft", MarginLeft)
+ATTR____(0x5392ea58u, "stroke", Stroke)
+ATTR____(0x5404d6dfu, "moduleHeight", ModuleHeight)
+ATTR____(0x54fa722cu, "transferEncoding", TransferEncoding)
+ATTR____(0x552d9ad5u, "usage", Usage)
+ATTR____(0x570ce835u, "presence", Presence)
+ATTR____(0x5739d1ffu, "radixOffset", RadixOffset)
+ATTR____(0x577682acu, "preserve", Preserve)
+ATTR____(0x58be2870u, "aliasNode", AliasNode)
+ATTR____(0x5a32e493u, "multiLine", MultiLine)
+ATTR____(0x5a50e9e6u, "version", Version)
+ATTR____(0x5ab23b6cu, "startChar", StartChar)
+ATTR____(0x5b707a35u, "scriptTest", ScriptTest)
+ATTR____(0x5c054755u, "startAngle", StartAngle)
+ATTR____(0x5ec958c0u, "cursorType", CursorType)
+ATTR____(0x5f760b50u, "digitalSignature", DigitalSignature)
+ATTR____(0x60a61eddu, "codeType", CodeType)
+ATTR____(0x60d4c8b1u, "output", Output)
+ATTR____(0x64110ab5u, "bookendTrailer", BookendTrailer)
+ATTR____(0x65e30c67u, "imagingBBox", ImagingBBox)
+ATTR____(0x66539c48u, "excludeInitialCap", ExcludeInitialCap)
+ATTR____(0x66642f8fu, "force", Force)
+ATTR____(0x69aa2292u, "crlSign", CrlSign)
+ATTR____(0x6a3405ddu, "previous", Previous)
+ATTR____(0x6a95c976u, "pushCharacterCount", PushCharacterCount)
+ATTR____(0x6b6ddcfbu, "nullTest", NullTest)
+ATTR____(0x6cfa828au, "runAt", RunAt)
+ATTR____(0x731e0665u, "spaceBelow", SpaceBelow)
+ATTR____(0x74788f8bu, "sweepAngle", SweepAngle)
+ATTR____(0x78bff531u, "numberOfCells", NumberOfCells)
+ATTR____(0x79543055u, "letterSpacing", LetterSpacing)
+ATTR____(0x79975f2bu, "lockType", LockType)
+ATTR____(0x7a0cc471u, "passwordChar", PasswordChar)
+ATTR____(0x7a7cc341u, "vAlign", VAlign)
+ATTR____(0x7b29630au, "sourceBelow", SourceBelow)
+ATTR____(0x7b95e661u, "inverted", Inverted)
+ATTR____(0x7c2fd80bu, "mark", Mark)
+ATTR____(0x7c2ff6aeu, "maxH", MaxH)
+ATTR____(0x7c2ff6bdu, "maxW", MaxW)
+ATTR____(0x7c732a66u, "truncate", Truncate)
+ATTR____(0x7d02356cu, "minH", MinH)
+ATTR____(0x7d02357bu, "minW", MinW)
+ATTR____(0x7d0b5fcau, "initial", Initial)
+ATTR____(0x7d9fd7c5u, "mode", Mode)
+ATTR____(0x7e7e845eu, "layout", Layout)
+ATTR____(0x7f6fd3d7u, "server", Server)
+ATTR____(0x824f21b7u, "embedPDF", EmbedPDF)
+ATTR____(0x8340ea66u, "oddOrEven", OddOrEven)
+ATTR____(0x836d4d7cu, "tabDefault", TabDefault)
+ATTR____(0x8855805fu, "contains", Contains)
+ATTR____(0x8a692521u, "rightInset", RightInset)
+ATTR____(0x8af2e657u, "maxChars", MaxChars)
+ATTR____(0x8b90e1f2u, "open", Open)
+ATTR____(0x8c99377eu, "relation", Relation)
+ATTR____(0x8d181d61u, "wideNarrowRatio", WideNarrowRatio)
+ATTR____(0x8e1c2921u, "relevant", Relevant)
+ATTR____(0x8e29d794u, "signatureType", SignatureType)
+ATTR____(0x8ec6204cu, "lineThroughPeriod", LineThroughPeriod)
+ATTR____(0x8ed182d1u, "shape", Shape)
+ATTR____(0x8fa01790u, "tabStops", TabStops)
+ATTR____(0x8fc36c0au, "outputBelow", OutputBelow)
+ATTR____(0x9041d4b0u, "short", Short)
+ATTR____(0x907c7719u, "fontVerticalScale", FontVerticalScale)
+ATTR____(0x94446dccu, "thickness", Thickness)
+ATTR____(0x957fa006u, "commitOn", CommitOn)
+ATTR____(0x982bd892u, "remainCharacterCount", RemainCharacterCount)
+ATTR____(0x98fd4d81u, "keyAgreement", KeyAgreement)
+ATTR____(0x99800d7au, "errorCorrectionLevel", ErrorCorrectionLevel)
+ATTR____(0x9a63da3du, "upsMode", UpsMode)
+ATTR____(0x9cc17d75u, "mergeMode", MergeMode)
+ATTR____(0x9d833d75u, "circular", Circular)
+ATTR____(0x9d8ee204u, "psName", PsName)
+ATTR____(0x9dcc3ab3u, "trailer", Trailer)
+ATTR____(0xa0933954u, "unicodeRange", UnicodeRange)
+ATTR____(0xa1b0d2f5u, "executeType", ExecuteType)
+ATTR____(0xa25a883du, "duplexImposition", DuplexImposition)
+ATTR____(0xa42ca1b7u, "trayIn", TrayIn)
+ATTR____(0xa433f001u, "bindingNode", BindingNode)
+ATTR____(0xa5340ff5u, "bofAction", BofAction)
+ATTR____(0xa5b410cfu, "save", Save)
+ATTR____(0xa6118c89u, "targetType", TargetType)
+ATTR____(0xa66404cbu, "keyEncipherment", KeyEncipherment)
+ATTR____(0xa6710262u, "credentialServerPolicy", CredentialServerPolicy)
+ATTR____(0xa686975bu, "size", Size)
+ATTR____(0xa85e74f3u, "initialNumber", InitialNumber)
+ATTR____(0xabef37e3u, "slope", Slope)
+ATTR____(0xabfa6c4fu, "cSpace", CSpace)
+ATTR____(0xac06e2b0u, "colSpan", ColSpan)
+ATTR____(0xadc4c77bu, "binding", Binding)
+ATTR____(0xaf754613u, "checksum", Checksum)
+ATTR____(0xb045fbc5u, "charEncoding", CharEncoding)
+ATTR____(0xb0e5485du, "bind", Bind)
+ATTR____(0xb12128b7u, "textEntry", TextEntry)
+ATTR____(0xb373a862u, "archive", Archive)
+ATTR____(0xb598a1f7u, "uuid", Uuid)
+ATTR____(0xb5e49bf2u, "posture", Posture)
+ATTR____(0xb6b44172u, "after", After)
+ATTR____(0xb716467bu, "orphans", Orphans)
+ATTR____(0xbc0c4695u, "qualifiedName", QualifiedName)
+ATTR____(0xbc254332u, "usehref", Usehref)
+ATTR____(0xbc8fa350u, "locale", Locale)
+ATTR____(0xbd6e1d88u, "weight", Weight)
+ATTR____(0xbd96a0e9u, "underlinePeriod", UnderlinePeriod)
+ATTR____(0xbde9abdau, "data", Data)
+ATTR____(0xbe52dfbfu, "desc", Desc)
+ATTR____(0xbe9ba472u, "numbered", Numbered)
+ATTR____(0xc035c6b1u, "dataColumnCount", DataColumnCount)
+ATTR____(0xc0ec9fa4u, "overline", Overline)
+ATTR____(0xc2ba0923u, "urlPolicy", UrlPolicy)
+ATTR____(0xc2bd40fdu, "anchorType", AnchorType)
+ATTR____(0xc39a88bdu, "labelRef", LabelRef)
+ATTR____(0xc3c1442fu, "bookendLeader", BookendLeader)
+ATTR____(0xc4547a08u, "maxLength", MaxLength)
+ATTR____(0xc4fed09bu, "accessKey", AccessKey)
+ATTR____(0xc5762157u, "cursorLocation", CursorLocation)
+ATTR____(0xc860f30au, "delayedOpen", DelayedOpen)
+ATTR____(0xc8da4da7u, "target", Target)
+ATTR____(0xca5dc27cu, "dataEncipherment", DataEncipherment)
+ATTR____(0xcb150479u, "afterTarget", AfterTarget)
+ATTR____(0xcbcaf66du, "leader", Leader)
+ATTR____(0xcca7897eu, "picker", Picker)
+ATTR____(0xcd7f7b54u, "from", From)
+ATTR____(0xcea5e62cu, "baseProfile", BaseProfile)
+ATTR____(0xd171b240u, "aspect", Aspect)
+ATTR____(0xd3c84d25u, "rowColumnRatio", RowColumnRatio)
+ATTR____(0xd4b01921u, "lineHeight", LineHeight)
+ATTR____(0xd4cc53f8u, "highlight", Highlight)
+ATTR____(0xd50f903au, "valueRef", ValueRef)
+ATTR____(0xd52482e0u, "maxEntries", MaxEntries)
+ATTR____(0xd57c513cu, "dataLength", DataLength)
+ATTR____(0xd6128d8du, "activity", Activity)
+ATTR____(0xd6a39990u, "input", Input)
+ATTR____(0xd6e27f1du, "value", Value)
+ATTR____(0xd70798c2u, "blankOrNotBlank", BlankOrNotBlank)
+ATTR____(0xd861f8afu, "addRevocationInfo", AddRevocationInfo)
+ATTR____(0xd8f982bfu, "genericFamily", GenericFamily)
+ATTR____(0xd996fa9bu, "hand", Hand)
+ATTR____(0xdb55fec5u, "href", Href)
+ATTR____(0xdc75676cu, "textEncoding", TextEncoding)
+ATTR____(0xde7f92bau, "leadDigits", LeadDigits)
+ATTR____(0xe11a2cbcu, "permissions", Permissions)
+ATTR____(0xe18b5659u, "spaceAbove", SpaceAbove)
+ATTR____(0xe1a26b56u, "codeBase", CodeBase)
+ATTR____(0xe349d044u, "stock", Stock)
+ATTR____(0xe372ae97u, "isNull", IsNull)
+ATTR____(0xe4c3a5e5u, "restoreState", RestoreState)
+ATTR____(0xe5c96d6au, "excludeAllCaps", ExcludeAllCaps)
+ATTR____(0xe64b1129u, "formatTest", FormatTest)
+ATTR____(0xe6f99487u, "hScrollPolicy", HScrollPolicy)
+ATTR____(0xe8dddf50u, "join", Join)
+ATTR____(0xe8f118a8u, "keyCertSign", KeyCertSign)
+ATTR____(0xe948b9a8u, "radius", Radius)
+ATTR____(0xe996b2feu, "sourceAbove", SourceAbove)
+ATTR____(0xea7090a0u, "override", Override)
+ATTR____(0xeb091003u, "classId", ClassId)
+ATTR____(0xeb511b54u, "disable", Disable)
+ATTR____(0xeda9017au, "scope", Scope)
+ATTR____(0xf197844du, "match", Match)
+ATTR____(0xf2009339u, "placement", Placement)
+ATTR____(0xf4ffce73u, "before", Before)
+ATTR____(0xf531b059u, "writingScript", WritingScript)
+ATTR____(0xf575ca75u, "endChar", EndChar)
+ATTR____(0xf6b47749u, "lock", Lock)
+ATTR____(0xf6b4afb0u, "long", Long)
+ATTR____(0xf6b59543u, "intact", Intact)
+ATTR____(0xf889e747u, "xdpContent", XdpContent)
+ATTR____(0xfea53ec6u, "decipherOnly", DecipherOnly)
diff --git a/xfa/fxfa/parser/cxfa_node_statics.cpp b/xfa/fxfa/parser/cxfa_node_statics.cpp
index 85ad86f..08242b6 100644
--- a/xfa/fxfa/parser/cxfa_node_statics.cpp
+++ b/xfa/fxfa/parser/cxfa_node_statics.cpp
@@ -649,758 +649,25 @@
   XFA_Attribute attribute;
 };
 
-#undef NAME
-#define NAME(a, b, c) a, c
-
 const AttributeNameInfo AttributeNameInfoToEnum[] = {
-    {NAME(0x68, "h", XFA_Attribute::H)},
-    {NAME(0x77, "w", XFA_Attribute::W)},
-    {NAME(0x78, "x", XFA_Attribute::X)},
-    {NAME(0x79, "y", XFA_Attribute::Y)},
-    {NAME(0x21aed, "id", XFA_Attribute::Id)},
-    {NAME(0x25363, "to", XFA_Attribute::To)},
-    {NAME(0xcb0ac9, "lineThrough", XFA_Attribute::LineThrough)},
-    {NAME(0x2282c73, "hAlign", XFA_Attribute::HAlign)},
-    {NAME(0x2c1c7f1, "typeface", XFA_Attribute::Typeface)},
-    {NAME(0x3106c3a, "beforeTarget", XFA_Attribute::BeforeTarget)},
-    {NAME(0x31b19c1, "name", XFA_Attribute::Name)},
-    {NAME(0x3848b3f, "next", XFA_Attribute::Next)},
-    {NAME(0x43e349b, "dataRowCount", XFA_Attribute::DataRowCount)},
-    {NAME(0x5518c25, "break", XFA_Attribute::Break)},
-    {NAME(0x5ce6195, "vScrollPolicy", XFA_Attribute::VScrollPolicy)},
-    {NAME(0x8c74ae9,
-          "fontHorizontalScale",
-          XFA_Attribute::FontHorizontalScale)},
-    {NAME(0x8d4f1c7, "textIndent", XFA_Attribute::TextIndent)},
-    {NAME(0x97c1c65, "context", XFA_Attribute::Context)},
-    {NAME(0x9876578, "trayOut", XFA_Attribute::TrayOut)},
-    {NAME(0xa2e3514, "cap", XFA_Attribute::Cap)},
-    {NAME(0xb3543a6, "max", XFA_Attribute::Max)},
-    {NAME(0xb356ca4, "min", XFA_Attribute::Min)},
-    {NAME(0xbb8df5d, "ref", XFA_Attribute::Ref)},
-    {NAME(0xbb8f3df, "rid", XFA_Attribute::Rid)},
-    {NAME(0xc080cd3, "url", XFA_Attribute::Url)},
-    {NAME(0xc0811ed, "use", XFA_Attribute::Use)},
-    {NAME(0xcfea02e, "leftInset", XFA_Attribute::LeftInset)},
-    {NAME(0x1026c59d, "widows", XFA_Attribute::Widows)},
-    {NAME(0x1059ec18, "level", XFA_Attribute::Level)},
-    {NAME(0x1356caf8, "bottomInset", XFA_Attribute::BottomInset)},
-    {NAME(0x13a08bdb, "overflowTarget", XFA_Attribute::OverflowTarget)},
-    {NAME(0x1414d431, "allowMacro", XFA_Attribute::AllowMacro)},
-    {NAME(0x14a32d52, "pagePosition", XFA_Attribute::PagePosition)},
-    {NAME(0x1517dfa1, "columnWidths", XFA_Attribute::ColumnWidths)},
-    {NAME(0x169134a1, "overflowLeader", XFA_Attribute::OverflowLeader)},
-    {NAME(0x1b8dce3e, "action", XFA_Attribute::Action)},
-    {NAME(0x1e459b8f, "nonRepudiation", XFA_Attribute::NonRepudiation)},
-    {NAME(0x1ec8ab2c, "rate", XFA_Attribute::Rate)},
-    {NAME(0x1ef3a64a, "allowRichText", XFA_Attribute::AllowRichText)},
-    {NAME(0x2038c9b2, "role", XFA_Attribute::Role)},
-    {NAME(0x20914367, "overflowTrailer", XFA_Attribute::OverflowTrailer)},
-    {NAME(0x226ca8f1, "operation", XFA_Attribute::Operation)},
-    {NAME(0x24d85167, "timeout", XFA_Attribute::Timeout)},
-    {NAME(0x25764436, "topInset", XFA_Attribute::TopInset)},
-    {NAME(0x25839852, "access", XFA_Attribute::Access)},
-    {NAME(0x268b7ec1, "commandType", XFA_Attribute::CommandType)},
-    {NAME(0x28dee6e9, "format", XFA_Attribute::Format)},
-    {NAME(0x28e17e91, "dataPrep", XFA_Attribute::DataPrep)},
-    {NAME(0x292b88fe, "widgetData", XFA_Attribute::WidgetData)},
-    {NAME(0x29418bb7, "abbr", XFA_Attribute::Abbr)},
-    {NAME(0x2a82d99c, "marginRight", XFA_Attribute::MarginRight)},
-    {NAME(0x2b5df51e, "dataDescription", XFA_Attribute::DataDescription)},
-    {NAME(0x2bb3f470, "encipherOnly", XFA_Attribute::EncipherOnly)},
-    {NAME(0x2cd79033, "kerningMode", XFA_Attribute::KerningMode)},
-    {NAME(0x2ee7678f, "rotate", XFA_Attribute::Rotate)},
-    {NAME(0x2f105f72, "wordCharacterCount", XFA_Attribute::WordCharacterCount)},
-    {NAME(0x2f16a382, "type", XFA_Attribute::Type)},
-    {NAME(0x34ae103c, "reserve", XFA_Attribute::Reserve)},
-    {NAME(0x3650557e, "textLocation", XFA_Attribute::TextLocation)},
-    {NAME(0x39cdb0a2, "priority", XFA_Attribute::Priority)},
-    {NAME(0x3a0273a6, "underline", XFA_Attribute::Underline)},
-    {NAME(0x3b582286, "moduleWidth", XFA_Attribute::ModuleWidth)},
-    {NAME(0x3d123c26, "hyphenate", XFA_Attribute::Hyphenate)},
-    {NAME(0x3e7af94f, "listen", XFA_Attribute::Listen)},
-    {NAME(0x4156ee3f, "delimiter", XFA_Attribute::Delimiter)},
-    {NAME(0x42fed1fd, "contentType", XFA_Attribute::ContentType)},
-    {NAME(0x453eaf38, "startNew", XFA_Attribute::StartNew)},
-    {NAME(0x45a6daf8, "eofAction", XFA_Attribute::EofAction)},
-    {NAME(0x47cfa43a, "allowNeutral", XFA_Attribute::AllowNeutral)},
-    {NAME(0x47d03490, "connection", XFA_Attribute::Connection)},
-    {NAME(0x4873c601, "baselineShift", XFA_Attribute::BaselineShift)},
-    {NAME(0x4b319767, "overlinePeriod", XFA_Attribute::OverlinePeriod)},
-    {NAME(0x4b8bc840, "fracDigits", XFA_Attribute::FracDigits)},
-    {NAME(0x4ef3d02c, "orientation", XFA_Attribute::Orientation)},
-    {NAME(0x4fdc3454, "timeStamp", XFA_Attribute::TimeStamp)},
-    {NAME(0x52666f1c, "printCheckDigit", XFA_Attribute::PrintCheckDigit)},
-    {NAME(0x534729c9, "marginLeft", XFA_Attribute::MarginLeft)},
-    {NAME(0x5392ea58, "stroke", XFA_Attribute::Stroke)},
-    {NAME(0x5404d6df, "moduleHeight", XFA_Attribute::ModuleHeight)},
-    {NAME(0x54fa722c, "transferEncoding", XFA_Attribute::TransferEncoding)},
-    {NAME(0x552d9ad5, "usage", XFA_Attribute::Usage)},
-    {NAME(0x570ce835, "presence", XFA_Attribute::Presence)},
-    {NAME(0x5739d1ff, "radixOffset", XFA_Attribute::RadixOffset)},
-    {NAME(0x577682ac, "preserve", XFA_Attribute::Preserve)},
-    {NAME(0x58be2870, "aliasNode", XFA_Attribute::AliasNode)},
-    {NAME(0x5a32e493, "multiLine", XFA_Attribute::MultiLine)},
-    {NAME(0x5a50e9e6, "version", XFA_Attribute::Version)},
-    {NAME(0x5ab23b6c, "startChar", XFA_Attribute::StartChar)},
-    {NAME(0x5b707a35, "scriptTest", XFA_Attribute::ScriptTest)},
-    {NAME(0x5c054755, "startAngle", XFA_Attribute::StartAngle)},
-    {NAME(0x5ec958c0, "cursorType", XFA_Attribute::CursorType)},
-    {NAME(0x5f760b50, "digitalSignature", XFA_Attribute::DigitalSignature)},
-    {NAME(0x60a61edd, "codeType", XFA_Attribute::CodeType)},
-    {NAME(0x60d4c8b1, "output", XFA_Attribute::Output)},
-    {NAME(0x64110ab5, "bookendTrailer", XFA_Attribute::BookendTrailer)},
-    {NAME(0x65e30c67, "imagingBBox", XFA_Attribute::ImagingBBox)},
-    {NAME(0x66539c48, "excludeInitialCap", XFA_Attribute::ExcludeInitialCap)},
-    {NAME(0x66642f8f, "force", XFA_Attribute::Force)},
-    {NAME(0x69aa2292, "crlSign", XFA_Attribute::CrlSign)},
-    {NAME(0x6a3405dd, "previous", XFA_Attribute::Previous)},
-    {NAME(0x6a95c976, "pushCharacterCount", XFA_Attribute::PushCharacterCount)},
-    {NAME(0x6b6ddcfb, "nullTest", XFA_Attribute::NullTest)},
-    {NAME(0x6cfa828a, "runAt", XFA_Attribute::RunAt)},
-    {NAME(0x731e0665, "spaceBelow", XFA_Attribute::SpaceBelow)},
-    {NAME(0x74788f8b, "sweepAngle", XFA_Attribute::SweepAngle)},
-    {NAME(0x78bff531, "numberOfCells", XFA_Attribute::NumberOfCells)},
-    {NAME(0x79543055, "letterSpacing", XFA_Attribute::LetterSpacing)},
-    {NAME(0x79975f2b, "lockType", XFA_Attribute::LockType)},
-    {NAME(0x7a0cc471, "passwordChar", XFA_Attribute::PasswordChar)},
-    {NAME(0x7a7cc341, "vAlign", XFA_Attribute::VAlign)},
-    {NAME(0x7b29630a, "sourceBelow", XFA_Attribute::SourceBelow)},
-    {NAME(0x7b95e661, "inverted", XFA_Attribute::Inverted)},
-    {NAME(0x7c2fd80b, "mark", XFA_Attribute::Mark)},
-    {NAME(0x7c2ff6ae, "maxH", XFA_Attribute::MaxH)},
-    {NAME(0x7c2ff6bd, "maxW", XFA_Attribute::MaxW)},
-    {NAME(0x7c732a66, "truncate", XFA_Attribute::Truncate)},
-    {NAME(0x7d02356c, "minH", XFA_Attribute::MinH)},
-    {NAME(0x7d02357b, "minW", XFA_Attribute::MinW)},
-    {NAME(0x7d0b5fca, "initial", XFA_Attribute::Initial)},
-    {NAME(0x7d9fd7c5, "mode", XFA_Attribute::Mode)},
-    {NAME(0x7e7e845e, "layout", XFA_Attribute::Layout)},
-    {NAME(0x7f6fd3d7, "server", XFA_Attribute::Server)},
-    {NAME(0x824f21b7, "embedPDF", XFA_Attribute::EmbedPDF)},
-    {NAME(0x8340ea66, "oddOrEven", XFA_Attribute::OddOrEven)},
-    {NAME(0x836d4d7c, "tabDefault", XFA_Attribute::TabDefault)},
-    {NAME(0x8855805f, "contains", XFA_Attribute::Contains)},
-    {NAME(0x8a692521, "rightInset", XFA_Attribute::RightInset)},
-    {NAME(0x8af2e657, "maxChars", XFA_Attribute::MaxChars)},
-    {NAME(0x8b90e1f2, "open", XFA_Attribute::Open)},
-    {NAME(0x8c99377e, "relation", XFA_Attribute::Relation)},
-    {NAME(0x8d181d61, "wideNarrowRatio", XFA_Attribute::WideNarrowRatio)},
-    {NAME(0x8e1c2921, "relevant", XFA_Attribute::Relevant)},
-    {NAME(0x8e29d794, "signatureType", XFA_Attribute::SignatureType)},
-    {NAME(0x8ec6204c, "lineThroughPeriod", XFA_Attribute::LineThroughPeriod)},
-    {NAME(0x8ed182d1, "shape", XFA_Attribute::Shape)},
-    {NAME(0x8fa01790, "tabStops", XFA_Attribute::TabStops)},
-    {NAME(0x8fc36c0a, "outputBelow", XFA_Attribute::OutputBelow)},
-    {NAME(0x9041d4b0, "short", XFA_Attribute::Short)},
-    {NAME(0x907c7719, "fontVerticalScale", XFA_Attribute::FontVerticalScale)},
-    {NAME(0x94446dcc, "thickness", XFA_Attribute::Thickness)},
-    {NAME(0x957fa006, "commitOn", XFA_Attribute::CommitOn)},
-    {NAME(0x982bd892,
-          "remainCharacterCount",
-          XFA_Attribute::RemainCharacterCount)},
-    {NAME(0x98fd4d81, "keyAgreement", XFA_Attribute::KeyAgreement)},
-    {NAME(0x99800d7a,
-          "errorCorrectionLevel",
-          XFA_Attribute::ErrorCorrectionLevel)},
-    {NAME(0x9a63da3d, "upsMode", XFA_Attribute::UpsMode)},
-    {NAME(0x9cc17d75, "mergeMode", XFA_Attribute::MergeMode)},
-    {NAME(0x9d833d75, "circular", XFA_Attribute::Circular)},
-    {NAME(0x9d8ee204, "psName", XFA_Attribute::PsName)},
-    {NAME(0x9dcc3ab3, "trailer", XFA_Attribute::Trailer)},
-    {NAME(0xa0933954, "unicodeRange", XFA_Attribute::UnicodeRange)},
-    {NAME(0xa1b0d2f5, "executeType", XFA_Attribute::ExecuteType)},
-    {NAME(0xa25a883d, "duplexImposition", XFA_Attribute::DuplexImposition)},
-    {NAME(0xa42ca1b7, "trayIn", XFA_Attribute::TrayIn)},
-    {NAME(0xa433f001, "bindingNode", XFA_Attribute::BindingNode)},
-    {NAME(0xa5340ff5, "bofAction", XFA_Attribute::BofAction)},
-    {NAME(0xa5b410cf, "save", XFA_Attribute::Save)},
-    {NAME(0xa6118c89, "targetType", XFA_Attribute::TargetType)},
-    {NAME(0xa66404cb, "keyEncipherment", XFA_Attribute::KeyEncipherment)},
-    {NAME(0xa6710262,
-          "credentialServerPolicy",
-          XFA_Attribute::CredentialServerPolicy)},
-    {NAME(0xa686975b, "size", XFA_Attribute::Size)},
-    {NAME(0xa85e74f3, "initialNumber", XFA_Attribute::InitialNumber)},
-    {NAME(0xabef37e3, "slope", XFA_Attribute::Slope)},
-    {NAME(0xabfa6c4f, "cSpace", XFA_Attribute::CSpace)},
-    {NAME(0xac06e2b0, "colSpan", XFA_Attribute::ColSpan)},
-    {NAME(0xadc4c77b, "binding", XFA_Attribute::Binding)},
-    {NAME(0xaf754613, "checksum", XFA_Attribute::Checksum)},
-    {NAME(0xb045fbc5, "charEncoding", XFA_Attribute::CharEncoding)},
-    {NAME(0xb0e5485d, "bind", XFA_Attribute::Bind)},
-    {NAME(0xb12128b7, "textEntry", XFA_Attribute::TextEntry)},
-    {NAME(0xb373a862, "archive", XFA_Attribute::Archive)},
-    {NAME(0xb598a1f7, "uuid", XFA_Attribute::Uuid)},
-    {NAME(0xb5e49bf2, "posture", XFA_Attribute::Posture)},
-    {NAME(0xb6b44172, "after", XFA_Attribute::After)},
-    {NAME(0xb716467b, "orphans", XFA_Attribute::Orphans)},
-    {NAME(0xbc0c4695, "qualifiedName", XFA_Attribute::QualifiedName)},
-    {NAME(0xbc254332, "usehref", XFA_Attribute::Usehref)},
-    {NAME(0xbc8fa350, "locale", XFA_Attribute::Locale)},
-    {NAME(0xbd6e1d88, "weight", XFA_Attribute::Weight)},
-    {NAME(0xbd96a0e9, "underlinePeriod", XFA_Attribute::UnderlinePeriod)},
-    {NAME(0xbde9abda, "data", XFA_Attribute::Data)},
-    {NAME(0xbe52dfbf, "desc", XFA_Attribute::Desc)},
-    {NAME(0xbe9ba472, "numbered", XFA_Attribute::Numbered)},
-    {NAME(0xc035c6b1, "dataColumnCount", XFA_Attribute::DataColumnCount)},
-    {NAME(0xc0ec9fa4, "overline", XFA_Attribute::Overline)},
-    {NAME(0xc2ba0923, "urlPolicy", XFA_Attribute::UrlPolicy)},
-    {NAME(0xc2bd40fd, "anchorType", XFA_Attribute::AnchorType)},
-    {NAME(0xc39a88bd, "labelRef", XFA_Attribute::LabelRef)},
-    {NAME(0xc3c1442f, "bookendLeader", XFA_Attribute::BookendLeader)},
-    {NAME(0xc4547a08, "maxLength", XFA_Attribute::MaxLength)},
-    {NAME(0xc4fed09b, "accessKey", XFA_Attribute::AccessKey)},
-    {NAME(0xc5762157, "cursorLocation", XFA_Attribute::CursorLocation)},
-    {NAME(0xc860f30a, "delayedOpen", XFA_Attribute::DelayedOpen)},
-    {NAME(0xc8da4da7, "target", XFA_Attribute::Target)},
-    {NAME(0xca5dc27c, "dataEncipherment", XFA_Attribute::DataEncipherment)},
-    {NAME(0xcb150479, "afterTarget", XFA_Attribute::AfterTarget)},
-    {NAME(0xcbcaf66d, "leader", XFA_Attribute::Leader)},
-    {NAME(0xcca7897e, "picker", XFA_Attribute::Picker)},
-    {NAME(0xcd7f7b54, "from", XFA_Attribute::From)},
-    {NAME(0xcea5e62c, "baseProfile", XFA_Attribute::BaseProfile)},
-    {NAME(0xd171b240, "aspect", XFA_Attribute::Aspect)},
-    {NAME(0xd3c84d25, "rowColumnRatio", XFA_Attribute::RowColumnRatio)},
-    {NAME(0xd4b01921, "lineHeight", XFA_Attribute::LineHeight)},
-    {NAME(0xd4cc53f8, "highlight", XFA_Attribute::Highlight)},
-    {NAME(0xd50f903a, "valueRef", XFA_Attribute::ValueRef)},
-    {NAME(0xd52482e0, "maxEntries", XFA_Attribute::MaxEntries)},
-    {NAME(0xd57c513c, "dataLength", XFA_Attribute::DataLength)},
-    {NAME(0xd6128d8d, "activity", XFA_Attribute::Activity)},
-    {NAME(0xd6a39990, "input", XFA_Attribute::Input)},
-    {NAME(0xd6e27f1d, "value", XFA_Attribute::Value)},
-    {NAME(0xd70798c2, "blankOrNotBlank", XFA_Attribute::BlankOrNotBlank)},
-    {NAME(0xd861f8af, "addRevocationInfo", XFA_Attribute::AddRevocationInfo)},
-    {NAME(0xd8f982bf, "genericFamily", XFA_Attribute::GenericFamily)},
-    {NAME(0xd996fa9b, "hand", XFA_Attribute::Hand)},
-    {NAME(0xdb55fec5, "href", XFA_Attribute::Href)},
-    {NAME(0xdc75676c, "textEncoding", XFA_Attribute::TextEncoding)},
-    {NAME(0xde7f92ba, "leadDigits", XFA_Attribute::LeadDigits)},
-    {NAME(0xe11a2cbc, "permissions", XFA_Attribute::Permissions)},
-    {NAME(0xe18b5659, "spaceAbove", XFA_Attribute::SpaceAbove)},
-    {NAME(0xe1a26b56, "codeBase", XFA_Attribute::CodeBase)},
-    {NAME(0xe349d044, "stock", XFA_Attribute::Stock)},
-    {NAME(0xe372ae97, "isNull", XFA_Attribute::IsNull)},
-    {NAME(0xe4c3a5e5, "restoreState", XFA_Attribute::RestoreState)},
-    {NAME(0xe5c96d6a, "excludeAllCaps", XFA_Attribute::ExcludeAllCaps)},
-    {NAME(0xe64b1129, "formatTest", XFA_Attribute::FormatTest)},
-    {NAME(0xe6f99487, "hScrollPolicy", XFA_Attribute::HScrollPolicy)},
-    {NAME(0xe8dddf50, "join", XFA_Attribute::Join)},
-    {NAME(0xe8f118a8, "keyCertSign", XFA_Attribute::KeyCertSign)},
-    {NAME(0xe948b9a8, "radius", XFA_Attribute::Radius)},
-    {NAME(0xe996b2fe, "sourceAbove", XFA_Attribute::SourceAbove)},
-    {NAME(0xea7090a0, "override", XFA_Attribute::Override)},
-    {NAME(0xeb091003, "classId", XFA_Attribute::ClassId)},
-    {NAME(0xeb511b54, "disable", XFA_Attribute::Disable)},
-    {NAME(0xeda9017a, "scope", XFA_Attribute::Scope)},
-    {NAME(0xf197844d, "match", XFA_Attribute::Match)},
-    {NAME(0xf2009339, "placement", XFA_Attribute::Placement)},
-    {NAME(0xf4ffce73, "before", XFA_Attribute::Before)},
-    {NAME(0xf531b059, "writingScript", XFA_Attribute::WritingScript)},
-    {NAME(0xf575ca75, "endChar", XFA_Attribute::EndChar)},
-    {NAME(0xf6b47749, "lock", XFA_Attribute::Lock)},
-    {NAME(0xf6b4afb0, "long", XFA_Attribute::Long)},
-    {NAME(0xf6b59543, "intact", XFA_Attribute::Intact)},
-    {NAME(0xf889e747, "xdpContent", XFA_Attribute::XdpContent)},
-    {NAME(0xfea53ec6, "decipherOnly", XFA_Attribute::DecipherOnly)},
+#undef ATTR____
+#define ATTR____(a, b, c) {a, XFA_Attribute::c},
+#include "xfa/fxfa/parser/attributes.inc"
+#undef ATTR____
 };
 
-#undef NAME
-
 const char* AttributeToNameASCII(XFA_Attribute attr) {
   switch (attr) {
-    case XFA_Attribute::H:
-      return "h";
-    case XFA_Attribute::W:
-      return "w";
-    case XFA_Attribute::X:
-      return "x";
-    case XFA_Attribute::Y:
-      return "y";
-    case XFA_Attribute::Id:
-      return "id";
-    case XFA_Attribute::To:
-      return "to";
-    case XFA_Attribute::LineThrough:
-      return "lineThrough";
-    case XFA_Attribute::HAlign:
-      return "hAlign";
-    case XFA_Attribute::Typeface:
-      return "typeface";
-    case XFA_Attribute::BeforeTarget:
-      return "beforeTarget";
-    case XFA_Attribute::Name:
-      return "name";
-    case XFA_Attribute::Next:
-      return "next";
-    case XFA_Attribute::DataRowCount:
-      return "dataRowCount";
-    case XFA_Attribute::Break:
-      return "break";
-    case XFA_Attribute::VScrollPolicy:
-      return "vScrollPolicy";
-    case XFA_Attribute::FontHorizontalScale:
-      return "fontHorizontalScale";
-    case XFA_Attribute::TextIndent:
-      return "textIndent";
-    case XFA_Attribute::Context:
-      return "context";
-    case XFA_Attribute::TrayOut:
-      return "trayOut";
-    case XFA_Attribute::Cap:
-      return "cap";
-    case XFA_Attribute::Max:
-      return "max";
-    case XFA_Attribute::Min:
-      return "min";
-    case XFA_Attribute::Ref:
-      return "ref";
-    case XFA_Attribute::Rid:
-      return "rid";
-    case XFA_Attribute::Url:
-      return "url";
-    case XFA_Attribute::Use:
-      return "use";
-    case XFA_Attribute::LeftInset:
-      return "leftInset";
-    case XFA_Attribute::Widows:
-      return "widows";
-    case XFA_Attribute::Level:
-      return "level";
-    case XFA_Attribute::BottomInset:
-      return "bottomInset";
-    case XFA_Attribute::OverflowTarget:
-      return "overflowTarget";
-    case XFA_Attribute::AllowMacro:
-      return "allowMacro";
-    case XFA_Attribute::PagePosition:
-      return "pagePosition";
-    case XFA_Attribute::ColumnWidths:
-      return "columnWidths";
-    case XFA_Attribute::OverflowLeader:
-      return "overflowLeader";
-    case XFA_Attribute::Action:
-      return "action";
-    case XFA_Attribute::NonRepudiation:
-      return "nonRepudiation";
-    case XFA_Attribute::Rate:
-      return "rate";
-    case XFA_Attribute::AllowRichText:
-      return "allowRichText";
-    case XFA_Attribute::Role:
-      return "role";
-    case XFA_Attribute::OverflowTrailer:
-      return "overflowTrailer";
-    case XFA_Attribute::Operation:
-      return "operation";
-    case XFA_Attribute::Timeout:
-      return "timeout";
-    case XFA_Attribute::TopInset:
-      return "topInset";
-    case XFA_Attribute::Access:
-      return "access";
-    case XFA_Attribute::CommandType:
-      return "commandType";
-    case XFA_Attribute::Format:
-      return "format";
-    case XFA_Attribute::DataPrep:
-      return "dataPrep";
-    case XFA_Attribute::WidgetData:
-      return "widgetData";
-    case XFA_Attribute::Abbr:
-      return "abbr";
-    case XFA_Attribute::MarginRight:
-      return "marginRight";
-    case XFA_Attribute::DataDescription:
-      return "dataDescription";
-    case XFA_Attribute::EncipherOnly:
-      return "encipherOnly";
-    case XFA_Attribute::KerningMode:
-      return "kerningMode";
-    case XFA_Attribute::Rotate:
-      return "rotate";
-    case XFA_Attribute::WordCharacterCount:
-      return "wordCharacterCount";
-    case XFA_Attribute::Type:
-      return "type";
-    case XFA_Attribute::Reserve:
-      return "reserve";
-    case XFA_Attribute::TextLocation:
-      return "textLocation";
-    case XFA_Attribute::Priority:
-      return "priority";
-    case XFA_Attribute::Underline:
-      return "underline";
-    case XFA_Attribute::ModuleWidth:
-      return "moduleWidth";
-    case XFA_Attribute::Hyphenate:
-      return "hyphenate";
-    case XFA_Attribute::Listen:
-      return "listen";
-    case XFA_Attribute::Delimiter:
-      return "delimiter";
-    case XFA_Attribute::ContentType:
-      return "contentType";
-    case XFA_Attribute::StartNew:
-      return "startNew";
-    case XFA_Attribute::EofAction:
-      return "eofAction";
-    case XFA_Attribute::AllowNeutral:
-      return "allowNeutral";
-    case XFA_Attribute::Connection:
-      return "connection";
-    case XFA_Attribute::BaselineShift:
-      return "baselineShift";
-    case XFA_Attribute::OverlinePeriod:
-      return "overlinePeriod";
-    case XFA_Attribute::FracDigits:
-      return "fracDigits";
-    case XFA_Attribute::Orientation:
-      return "orientation";
-    case XFA_Attribute::TimeStamp:
-      return "timeStamp";
-    case XFA_Attribute::PrintCheckDigit:
-      return "printCheckDigit";
-    case XFA_Attribute::MarginLeft:
-      return "marginLeft";
-    case XFA_Attribute::Stroke:
-      return "stroke";
-    case XFA_Attribute::ModuleHeight:
-      return "moduleHeight";
-    case XFA_Attribute::TransferEncoding:
-      return "transferEncoding";
-    case XFA_Attribute::Usage:
-      return "usage";
-    case XFA_Attribute::Presence:
-      return "presence";
-    case XFA_Attribute::RadixOffset:
-      return "radixOffset";
-    case XFA_Attribute::Preserve:
-      return "preserve";
-    case XFA_Attribute::AliasNode:
-      return "aliasNode";
-    case XFA_Attribute::MultiLine:
-      return "multiLine";
-    case XFA_Attribute::Version:
-      return "version";
-    case XFA_Attribute::StartChar:
-      return "startChar";
-    case XFA_Attribute::ScriptTest:
-      return "scriptTest";
-    case XFA_Attribute::StartAngle:
-      return "startAngle";
-    case XFA_Attribute::CursorType:
-      return "cursorType";
-    case XFA_Attribute::DigitalSignature:
-      return "digitalSignature";
-    case XFA_Attribute::CodeType:
-      return "codeType";
-    case XFA_Attribute::Output:
-      return "output";
-    case XFA_Attribute::BookendTrailer:
-      return "bookendTrailer";
-    case XFA_Attribute::ImagingBBox:
-      return "imagingBBox";
-    case XFA_Attribute::ExcludeInitialCap:
-      return "excludeInitialCap";
-    case XFA_Attribute::Force:
-      return "force";
-    case XFA_Attribute::CrlSign:
-      return "crlSign";
-    case XFA_Attribute::Previous:
-      return "previous";
-    case XFA_Attribute::PushCharacterCount:
-      return "pushCharacterCount";
-    case XFA_Attribute::NullTest:
-      return "nullTest";
-    case XFA_Attribute::RunAt:
-      return "runAt";
-    case XFA_Attribute::SpaceBelow:
-      return "spaceBelow";
-    case XFA_Attribute::SweepAngle:
-      return "sweepAngle";
-    case XFA_Attribute::NumberOfCells:
-      return "numberOfCells";
-    case XFA_Attribute::LetterSpacing:
-      return "letterSpacing";
-    case XFA_Attribute::LockType:
-      return "lockType";
-    case XFA_Attribute::PasswordChar:
-      return "passwordChar";
-    case XFA_Attribute::VAlign:
-      return "vAlign";
-    case XFA_Attribute::SourceBelow:
-      return "sourceBelow";
-    case XFA_Attribute::Inverted:
-      return "inverted";
-    case XFA_Attribute::Mark:
-      return "mark";
-    case XFA_Attribute::MaxH:
-      return "maxH";
-    case XFA_Attribute::MaxW:
-      return "maxW";
-    case XFA_Attribute::Truncate:
-      return "truncate";
-    case XFA_Attribute::MinH:
-      return "minH";
-    case XFA_Attribute::MinW:
-      return "minW";
-    case XFA_Attribute::Initial:
-      return "initial";
-    case XFA_Attribute::Mode:
-      return "mode";
-    case XFA_Attribute::Layout:
-      return "layout";
-    case XFA_Attribute::Server:
-      return "server";
-    case XFA_Attribute::EmbedPDF:
-      return "embedPDF";
-    case XFA_Attribute::OddOrEven:
-      return "oddOrEven";
-    case XFA_Attribute::TabDefault:
-      return "tabDefault";
-    case XFA_Attribute::Contains:
-      return "contains";
-    case XFA_Attribute::RightInset:
-      return "rightInset";
-    case XFA_Attribute::MaxChars:
-      return "maxChars";
-    case XFA_Attribute::Open:
-      return "open";
-    case XFA_Attribute::Relation:
-      return "relation";
-    case XFA_Attribute::WideNarrowRatio:
-      return "wideNarrowRatio";
-    case XFA_Attribute::Relevant:
-      return "relevant";
-    case XFA_Attribute::SignatureType:
-      return "signatureType";
-    case XFA_Attribute::LineThroughPeriod:
-      return "lineThroughPeriod";
-    case XFA_Attribute::Shape:
-      return "shape";
-    case XFA_Attribute::TabStops:
-      return "tabStops";
-    case XFA_Attribute::OutputBelow:
-      return "outputBelow";
-    case XFA_Attribute::Short:
-      return "short";
-    case XFA_Attribute::FontVerticalScale:
-      return "fontVerticalScale";
-    case XFA_Attribute::Thickness:
-      return "thickness";
-    case XFA_Attribute::CommitOn:
-      return "commitOn";
-    case XFA_Attribute::RemainCharacterCount:
-      return "remainCharacterCount";
-    case XFA_Attribute::KeyAgreement:
-      return "keyAgreement";
-    case XFA_Attribute::ErrorCorrectionLevel:
-      return "errorCorrectionLevel";
-    case XFA_Attribute::UpsMode:
-      return "upsMode";
-    case XFA_Attribute::MergeMode:
-      return "mergeMode";
-    case XFA_Attribute::Circular:
-      return "circular";
-    case XFA_Attribute::PsName:
-      return "psName";
-    case XFA_Attribute::Trailer:
-      return "trailer";
-    case XFA_Attribute::UnicodeRange:
-      return "unicodeRange";
-    case XFA_Attribute::ExecuteType:
-      return "executeType";
-    case XFA_Attribute::DuplexImposition:
-      return "duplexImposition";
-    case XFA_Attribute::TrayIn:
-      return "trayIn";
-    case XFA_Attribute::BindingNode:
-      return "bindingNode";
-    case XFA_Attribute::BofAction:
-      return "bofAction";
-    case XFA_Attribute::Save:
-      return "save";
-    case XFA_Attribute::TargetType:
-      return "targetType";
-    case XFA_Attribute::KeyEncipherment:
-      return "keyEncipherment";
-    case XFA_Attribute::CredentialServerPolicy:
-      return "credentialServerPolicy";
-    case XFA_Attribute::Size:
-      return "size";
-    case XFA_Attribute::InitialNumber:
-      return "initialNumber";
-    case XFA_Attribute::Slope:
-      return "slope";
-    case XFA_Attribute::CSpace:
-      return "cSpace";
-    case XFA_Attribute::ColSpan:
-      return "colSpan";
-    case XFA_Attribute::Binding:
-      return "binding";
-    case XFA_Attribute::Checksum:
-      return "checksum";
-    case XFA_Attribute::CharEncoding:
-      return "charEncoding";
-    case XFA_Attribute::Bind:
-      return "bind";
-    case XFA_Attribute::TextEntry:
-      return "textEntry";
-    case XFA_Attribute::Archive:
-      return "archive";
-    case XFA_Attribute::Uuid:
-      return "uuid";
-    case XFA_Attribute::Posture:
-      return "posture";
-    case XFA_Attribute::After:
-      return "after";
-    case XFA_Attribute::Orphans:
-      return "orphans";
-    case XFA_Attribute::QualifiedName:
-      return "qualifiedName";
-    case XFA_Attribute::Usehref:
-      return "usehref";
-    case XFA_Attribute::Locale:
-      return "locale";
-    case XFA_Attribute::Weight:
-      return "weight";
-    case XFA_Attribute::UnderlinePeriod:
-      return "underlinePeriod";
-    case XFA_Attribute::Data:
-      return "data";
-    case XFA_Attribute::Desc:
-      return "desc";
-    case XFA_Attribute::Numbered:
-      return "numbered";
-    case XFA_Attribute::DataColumnCount:
-      return "dataColumnCount";
-    case XFA_Attribute::Overline:
-      return "overline";
-    case XFA_Attribute::UrlPolicy:
-      return "urlPolicy";
-    case XFA_Attribute::AnchorType:
-      return "anchorType";
-    case XFA_Attribute::LabelRef:
-      return "labelRef";
-    case XFA_Attribute::BookendLeader:
-      return "bookendLeader";
-    case XFA_Attribute::MaxLength:
-      return "maxLength";
-    case XFA_Attribute::AccessKey:
-      return "accessKey";
-    case XFA_Attribute::CursorLocation:
-      return "cursorLocation";
-    case XFA_Attribute::DelayedOpen:
-      return "delayedOpen";
-    case XFA_Attribute::Target:
-      return "target";
-    case XFA_Attribute::DataEncipherment:
-      return "dataEncipherment";
-    case XFA_Attribute::AfterTarget:
-      return "afterTarget";
-    case XFA_Attribute::Leader:
-      return "leader";
-    case XFA_Attribute::Picker:
-      return "picker";
-    case XFA_Attribute::From:
-      return "from";
-    case XFA_Attribute::BaseProfile:
-      return "baseProfile";
-    case XFA_Attribute::Aspect:
-      return "aspect";
-    case XFA_Attribute::RowColumnRatio:
-      return "rowColumnRatio";
-    case XFA_Attribute::LineHeight:
-      return "lineHeight";
-    case XFA_Attribute::Highlight:
-      return "highlight";
-    case XFA_Attribute::ValueRef:
-      return "valueRef";
-    case XFA_Attribute::MaxEntries:
-      return "maxEntries";
-    case XFA_Attribute::DataLength:
-      return "dataLength";
-    case XFA_Attribute::Activity:
-      return "activity";
-    case XFA_Attribute::Input:
-      return "input";
-    case XFA_Attribute::Value:
-      return "value";
-    case XFA_Attribute::BlankOrNotBlank:
-      return "blankOrNotBlank";
-    case XFA_Attribute::AddRevocationInfo:
-      return "addRevocationInfo";
-    case XFA_Attribute::GenericFamily:
-      return "genericFamily";
-    case XFA_Attribute::Hand:
-      return "hand";
-    case XFA_Attribute::Href:
-      return "href";
-    case XFA_Attribute::TextEncoding:
-      return "textEncoding";
-    case XFA_Attribute::LeadDigits:
-      return "leadDigits";
-    case XFA_Attribute::Permissions:
-      return "permissions";
-    case XFA_Attribute::SpaceAbove:
-      return "spaceAbove";
-    case XFA_Attribute::CodeBase:
-      return "codeBase";
-    case XFA_Attribute::Stock:
-      return "stock";
-    case XFA_Attribute::IsNull:
-      return "isNull";
-    case XFA_Attribute::RestoreState:
-      return "restoreState";
-    case XFA_Attribute::ExcludeAllCaps:
-      return "excludeAllCaps";
-    case XFA_Attribute::FormatTest:
-      return "formatTest";
-    case XFA_Attribute::HScrollPolicy:
-      return "hScrollPolicy";
-    case XFA_Attribute::Join:
-      return "join";
-    case XFA_Attribute::KeyCertSign:
-      return "keyCertSign";
-    case XFA_Attribute::Radius:
-      return "radius";
-    case XFA_Attribute::SourceAbove:
-      return "sourceAbove";
-    case XFA_Attribute::Override:
-      return "override";
-    case XFA_Attribute::ClassId:
-      return "classId";
-    case XFA_Attribute::Disable:
-      return "disable";
-    case XFA_Attribute::Scope:
-      return "scope";
-    case XFA_Attribute::Match:
-      return "match";
-    case XFA_Attribute::Placement:
-      return "placement";
-    case XFA_Attribute::Before:
-      return "before";
-    case XFA_Attribute::WritingScript:
-      return "writingScript";
-    case XFA_Attribute::EndChar:
-      return "endChar";
-    case XFA_Attribute::Lock:
-      return "lock";
-    case XFA_Attribute::Long:
-      return "long";
-    case XFA_Attribute::Intact:
-      return "intact";
-    case XFA_Attribute::XdpContent:
-      return "xdpContent";
-    case XFA_Attribute::DecipherOnly:
-      return "decipherOnly";
+#undef ATTR____
+#define ATTR____(a, b, c) \
+  case XFA_Attribute::c:  \
+    return b;
+#include "xfa/fxfa/parser/attributes.inc"
+#undef ATTR____
     default:
       NOTREACHED();
-      break;
+      return "";
   }
-  return "";
 }
 
 }  // namespace
@@ -2354,5 +1621,5 @@
 
 // static
 WideString CXFA_Node::AttributeToName(XFA_Attribute attr) {
-  return WideString::FromASCII(ByteStringView(AttributeToNameASCII(attr)));
+  return WideString::FromASCII(AttributeToNameASCII(attr));
 }