question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gerated names should match XSD names

See original GitHub issue

When processing my XSD, which contains types like

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    elementFormDefault="qualified"
    xmlns="http://deuta.de/config/DeutaMsgDatabase"
    xmlns:d="http://deuta.de/config/DeutaMsgDatabase"
    targetNamespace="http://deuta.de/config/DeutaMsgDatabase">

    <xs:element name="MessageDB" type="TMessageDB">
...
    </xs:element>
    <xs:complexType name="TMessageDB">
...
    </xs:complexType>

i would have expected to have the xsdata class to be named TMessageDB, but it actually is TmessageDB.

Since i am trying to migrate away from another mapping tool which did not do this (pyxb), this would require a lot of API breakage on the client code, since that depends on the generated types a lot.

Is there an option to prevent that mapping to occur?

Regards

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hcw70commented, Sep 28, 2020

Looks good! Mixed case is the one i will be using most probably… 8.>

Maybe you should extend the name mapping table a bit to make more clear what happens with names like

  • test-elem
  • Test-Elem
  • testElem
  • TestElem
  • test_elem
0reactions
tefracommented, Sep 29, 2020

I will go with mixedSnakeCase instead of mixedUnderscoreCase

Read more comments on GitHub >

github_iconTop Results From Across the Web

Classes Generated with XSD.exe Custom Class Names
As far as I'm aware I don't think this is possible, the class names match almost exactly to whats in the schema. Personally...
Read more >
W3C XML Schema Definition Language (XSD) 1.1 Part 2
[Definition:] match. (Of strings or names:) Two strings or names being compared must be identical. Characters with multiple possible ...
Read more >
Defining common standard elements and types in generated ...
xmlElementName, Specifies the value of the element name from the common schema that should be referred to from the enclosing WSDL or XSD....
Read more >
XML Schema Definition (XSD) Structure - Support
In order for GenRocket to import, parse an XSD and convert its ... The value of the element.name parameter does not have to...
Read more >
Chapter 17 Binding between XML Schema and Java Classes
JAXB supports the grouping of generated classes in Java packages. A package consists of the following: A Java class name that is derived...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found