-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Stack overflow in XmlSchemaClassGenerator.ModelBuilder.CreatePropertiesForAttributes
#299
Comments
I've fixed this in 2.0.633. When generating, you still need to specifiy Do you have any test XML files so we can incorporate them into the unit tests? |
I use this XHTML to test. There are even repots that include styles like this one. 🙏 Thanks a lot. The fix in After I generated the classes for xhtml-inlinexbrl-1_1.xsd, the class var serializer = new XmlSerializer(typeof(XhtmlPeriodHtmlPeriodType));
(XhtmlPeriodHtmlPeriodType)serializer.Deserialize(xhtmlStream) Do you think I can replace xlink-2003-12-31.xsd with xlink.xsd to avoid the workaround in the future? Edit: Any chances to get "Groups with maxOccurs > 0" to work? I think that's another issue I have. It looks like the HTML elements only occurs once, e.g. the If I change [System.Xml.Serialization.XmlElementAttribute("div")]
public Xhtml.XhtmlPeriodDivPeriodType Div { get; set; } to [System.Xml.Serialization.XmlElementAttribute("div")]
public List<Xhtml.XhtmlPeriodDivPeriodType> Div { get; set; } I get all |
Regarding the first part (XLink): It works out of the box if you specify an individual C# namespace for the XML namespace Still investigating the second issue. |
Thanks. I added a custom namespace generator. Now, it creates the classes for both schemas 👍 . |
Found the cause of the other issue. My original fix wasn't actually a fix but merely made the symptoms of not handling redefines disappear. I've now added proper support for redefines in 2.0.634 which fixes the issue (at least for this schema). I've noticed that the Schaltbau.xhtml file isn't schema compliant: It uses lowercase elements which are defined as mixed case in the schema, e.g. |
I really appreciate your help, thanks a lot. I'm sorry that I couldn't contribute more. Maybe I can create a pull request with my namespace generator. It automatically appends and increases a number if the same namespace is used among different xsd files.
Version If nothing is left on your side, we can close the issue. Thanks again. |
I'm trying to generate XmlSerializer classes for xhtml-inlinexbrl-1_1.xsd. Unfortunately, it does not work. It cancels the generation with a stack overflow in
XmlSchemaClassGenerator.ModelBuilder.CreatePropertiesForAttributes
. I think it relates to the recursive call:XmlSchemaClassGenerator/XmlSchemaClassGenerator/ModelBuilder.cs
Line 835 in add51cc
I get following error:
CreatePropertiesForAttributes
gets called with following arguments: debug.log. Please notice the end of the log file, it always callesxhtml-image-1.xsd
. Any idea what could go wrong?To generate the classes I use:
The text was updated successfully, but these errors were encountered: