Skip to content

Commit

Permalink
feat: Use unicodedata.name on non-alphanumeric attr names
Browse files Browse the repository at this point in the history
  • Loading branch information
tefra committed Mar 23, 2024
1 parent 65c0342 commit f985115
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 62 deletions.
6 changes: 3 additions & 3 deletions output/instances/ibmData/valid/D3_4_6/d3_4_6v05.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
ele=[
'_ele',
],
value=[
low_line_hyphen_minus=[
'_-',
],
value_1=[
low_line_full_stop=[
'_.',
],
value_9=[
'_9',
],
value_2=[
low_line_low_line_low_line=[
'___',
],
a_a=[
Expand Down
2 changes: 1 addition & 1 deletion output/instances/ibmData/valid/D3_4_6/d3_4_6v06.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

obj = Root(
choice=[
Nametest.TypeType(
Nametest.LowLineHyphenMinus(
value='_-'
),
]
Expand Down
6 changes: 3 additions & 3 deletions output/instances/ibmData/valid/D3_4_6/d3_4_6v07.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
ele=[
'_ele',
],
value=[
low_line_hyphen_minus=[
'_-',
],
value_1=[
low_line_full_stop=[
'_.',
],
value_9=[
'_9',
],
value_2=[
low_line_low_line_low_line=[
'___',
'___',
],
Expand Down
14 changes: 7 additions & 7 deletions output/instances/msData/datatypes/Facets/anyURI/anyURI_b004.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
obj = Root(
bar=[
Bar(
value=St.VALUE_18
value=St.PLUS_SIGN
),
Bar(
value=St.VALUE_19
value=St.FULL_STOP_FULL_STOP
),
Bar(
value=St.VALUE_17
value=St.HYPHEN_MINUS
),
Bar(
value=St.VALUE_13
value=St.ASTERISK
),
Bar(
value=St.VALUE_14
value=St.LEFT_PARENTHESIS
),
Bar(
value=St.VALUE_16
value=St.LOW_LINE
),
Bar(
value=St.VALUE_20
value=St.FULL_STOP
),
]
)
2 changes: 1 addition & 1 deletion output/instances/saxonData/All/all001.v01.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.all.all007_xsd.all007 import Doc
from output.models.saxon_data.all.all001_xsd.all001 import Doc


obj = Doc(
Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/Open/open001.v1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.open.open001_xsd.open001 import Doc
from output.models.saxon_data.open.open002_xsd.open002 import Doc
from xsdata.formats.dataclass.models.generics import AnyElement


Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/Open/open001.v2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.open.open001_xsd.open001 import Doc
from output.models.saxon_data.open.open002_xsd.open002 import Doc
from xsdata.formats.dataclass.models.generics import AnyElement


Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/Open/open001.v3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.open.open001_xsd.open001 import Doc
from output.models.saxon_data.open.open002_xsd.open002 import Doc


obj = Doc(
Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/Override/over001.v01.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.override.over023_xsd.over023 import Doc
from output.models.saxon_data.override.over001_xsd.over001 import Doc
from xsdata.models.datatype import XmlDate


Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/VC/vc001.v1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.vc.vc008_xsd.vc008 import Temp
from output.models.saxon_data.vc.vc001_xsd.vc001 import Temp


obj = Temp(
Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/Zone/zone101.v02.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.zone.zone102_xsd.zone102 import Doc
from output.models.saxon_data.zone.zone101_xsd.zone101 import Doc
from xsdata.models.datatype import XmlDateTime


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@


obj = Root(
value=0,
low_line_hyphen_minus_full_stop=0,
value_0=1
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


obj = Root(
value=TypeType(
low_line_hyphen_minus_full_stop=TypeType(
value=0
),
value_0=Type0(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

obj = Root(
val=[
S.VALUE,
S.LOW_LINE_HYPHEN_MINUS_FULL_STOP,
S.VALUE_0,
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Nametest:
"min_occurs": 1,
},
)
value: List[str] = field(
low_line_hyphen_minus: List[str] = field(
default_factory=list,
metadata={
"name": "_-",
Expand All @@ -24,7 +24,7 @@ class Nametest:
"min_occurs": 1,
},
)
value_1: List[str] = field(
low_line_full_stop: List[str] = field(
default_factory=list,
metadata={
"name": "_.",
Expand All @@ -42,7 +42,7 @@ class Nametest:
"min_occurs": 1,
},
)
value_2: List[str] = field(
low_line_low_line_low_line: List[str] = field(
default_factory=list,
metadata={
"name": "___",
Expand Down
30 changes: 15 additions & 15 deletions output/models/ibm_data/valid/d3_4_6/d3_4_6v06_xsd/d3_4_6v06.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ class Nametest:
choice: List[
Union[
"Nametest.Ele",
"Nametest.TypeType",
"Nametest.Type1",
"Nametest.LowLineHyphenMinus",
"Nametest.LowLineFullStop",
"Nametest.Type9",
"Nametest.Type2",
"Nametest.LowLineLowLineLowLine",
"Nametest.AA",
"Nametest.AA1",
"Nametest.Ele1",
"Nametest.AAA",
"Nametest.AEle",
]
] = field(
default_factory=list,
Expand All @@ -29,12 +29,12 @@ class Nametest:
},
{
"name": "_-",
"type": Type["Nametest.TypeType"],
"type": Type["Nametest.LowLineHyphenMinus"],
"namespace": "a",
},
{
"name": "_.",
"type": Type["Nametest.Type1"],
"type": Type["Nametest.LowLineFullStop"],
"namespace": "a",
},
{
Expand All @@ -44,7 +44,7 @@ class Nametest:
},
{
"name": "___",
"type": Type["Nametest.Type2"],
"type": Type["Nametest.LowLineLowLineLowLine"],
"namespace": "a",
},
{
Expand All @@ -54,12 +54,12 @@ class Nametest:
},
{
"name": "a.a",
"type": Type["Nametest.AA1"],
"type": Type["Nametest.AAA"],
"namespace": "a",
},
{
"name": "ele",
"type": Type["Nametest.Ele1"],
"type": Type["Nametest.AEle"],
"namespace": "a",
},
),
Expand All @@ -76,7 +76,7 @@ class Ele:
)

@dataclass
class TypeType:
class LowLineHyphenMinus:
value: Optional[str] = field(
default=None,
metadata={
Expand All @@ -85,7 +85,7 @@ class TypeType:
)

@dataclass
class Type1:
class LowLineFullStop:
value: Optional[str] = field(
default=None,
metadata={
Expand All @@ -103,7 +103,7 @@ class Type9:
)

@dataclass
class Type2:
class LowLineLowLineLowLine:
value: Optional[str] = field(
default=None,
metadata={
Expand All @@ -121,7 +121,7 @@ class AA:
)

@dataclass
class AA1:
class AAA:
value: Optional[str] = field(
default=None,
metadata={
Expand All @@ -130,7 +130,7 @@ class AA1:
)

@dataclass
class Ele1:
class AEle:
value: Optional[str] = field(
default=None,
metadata={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Nametest:
"min_occurs": 1,
},
)
value: List[str] = field(
low_line_hyphen_minus: List[str] = field(
default_factory=list,
metadata={
"name": "_-",
Expand All @@ -24,7 +24,7 @@ class Nametest:
"min_occurs": 1,
},
)
value_1: List[str] = field(
low_line_full_stop: List[str] = field(
default_factory=list,
metadata={
"name": "_.",
Expand All @@ -42,7 +42,7 @@ class Nametest:
"min_occurs": 1,
},
)
value_2: List[str] = field(
low_line_low_line_low_line: List[str] = field(
default_factory=list,
metadata={
"name": "___",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ class St(Enum):
VALUE_7 = "7"
VALUE_8 = "8"
VALUE_9 = "9"
VALUE = "@"
VALUE_10 = "$"
VALUE_11 = "%"
VALUE_12 = "^"
VALUE_13 = "*"
VALUE_14 = "("
VALUE_15 = ")"
VALUE_16 = "_"
VALUE_17 = "-"
VALUE_18 = "+"
VALUE_19 = ".."
VALUE_20 = "."
VALUE_21 = "~"
VALUE_22 = "!"
COMMERCIAL_AT = "@"
DOLLAR_SIGN = "$"
PERCENT_SIGN = "%"
CIRCUMFLEX_ACCENT = "^"
ASTERISK = "*"
LEFT_PARENTHESIS = "("
RIGHT_PARENTHESIS = ")"
LOW_LINE = "_"
HYPHEN_MINUS = "-"
PLUS_SIGN = "+"
FULL_STOP_FULL_STOP = ".."
FULL_STOP = "."
TILDE = "~"
EXCLAMATION_MARK = "!"


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Meta:
name = "root"
namespace = "AttrDecl/name"

value: Optional[int] = field(
low_line_hyphen_minus_full_stop: Optional[int] = field(
default=None,
metadata={
"name": "_-.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Meta:
name = "root"
namespace = "ElemDecl/name"

value: Optional[TypeType] = field(
low_line_hyphen_minus_full_stop: Optional[TypeType] = field(
default=None,
metadata={
"name": "_-.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class S(Enum):
VALUE_0 = "_-0."
VALUE = "_-."
LOW_LINE_HYPHEN_MINUS_FULL_STOP = "_-."


@dataclass
Expand Down

0 comments on commit f985115

Please sign in to comment.