Quantcast
Channel: xsd2Code community edition .net class generator from XSD schema
Viewing all 543 articles
Browse latest View live

Commented Issue: xs:integer will become a string in some cases. [15554]

$
0
0
When a type is referenced it will not use the correct type.
In my example i expect the year month and day properties to be of type int.
Comments: ** Comment from web user: pego **

xs:integer is unbounded so it might be bigger than the [int] class in .NET can hold - remember the size in .NET is Signed 32-bit.

Try defining your type as xs:int and everything works fine!


New Post: Empty list of Artikels when i do a deserialize --- please help

$
0
0
Hello!

Im using the "xsd2Code" for my project on work.
we have a XML with a BillOfMaterial and inside we have '0' or 'many' Artikels.
When i load the XML into my object, the list with "Artikels" is empty.
Does someone know what i need change inside the XLS file to load all Artikels in the list?
(i can not make changes to the structure of the XML).


We have the folowing XML:

<?xml version="1.0" encoding="utf-8"?>
<ns0:MT_BillOfMaterial xmlns:ns0="http://namespace/BillOfMaterial">
<BillOfMaterial>
    <Indicator>F</Indicator>
    <Artikel>2000158</Artikel>
    <ReferentieHoeveelheid>96.935</ReferentieHoeveelheid>
    <Eenheid>KGM</Eenheid>
    <Versie>01</Versie>
    <GeldigVan>20150304</GeldigVan>
    <Omschrijving>MENG TB BATTER P012</Omschrijving>
    <Artikels>
        <Indicator>G</Indicator>
        <Artikel>2000014</Artikel>
        <Hoeveelheid>2.994-</Hoeveelheid>
        <Eenheid>KGM</Eenheid>
        <Omschrijving>GMP REINIGING BULK</Omschrijving>
    </Artikels>
    <Artikels>
        <Indicator>G</Indicator>
        <Artikel>7000000</Artikel>
        <Hoeveelheid>0.075-</Hoeveelheid>
        <Eenheid>KGM</Eenheid>
        <Omschrijving>KUISERIJ test</Omschrijving>
    </Artikels>
</BillOfMaterial>
</ns0:MT_BillOfMaterial>



The .XLS i created:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="BillOfMaterial">
<xs:complexType>
    <xs:sequence>
        <xs:element type="xs:string" name="Indicator"/>
        <xs:element type="xs:int" name="Artikel"/>
        <xs:element type="xs:float" name="ReferentieHoeveelheid"/>
        <xs:element type="xs:string" name="Eenheid"/>
        <xs:element type="xs:byte" name="Versie"/>
        <xs:element type="xs:int" name="GeldigVan"/>
        <xs:element type="xs:string" name="Omschrijving"/>
        <xs:element name="Artikels" type="ArtikelsCollection" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="ArtikelsCollection">
    <xs:sequence>
        <xs:element type="xs:string" name="Indicator"/>
        <xs:element type="xs:int" name="Artikel"/>
        <xs:element type="xs:string" name="Hoeveelheid"/>
        <xs:element type="xs:string" name="Eenheid"/>
        <xs:element type="xs:string" name="Omschrijving"/>
    </xs:sequence>
</xs:complexType>
</xs:schema>

New Post: How to specify the file name?

$
0
0
Did you ever find ever a solution to this problem?

New Post: Seems to add root names to sub elements

$
0
0
Did you ever find ever a solution to this problem?

Released: xsd2code community edition 3.4 (Nov 10, 2013)

$
0
0
Visual studio 2010, 2012, 2013.
NOTE : xsd2code community edition 3.4 do not support Vs 2015

Updated Release: xsd2code community edition 3.4 (nov. 10, 2013)

$
0
0
Visual studio 2010, 2012, 2013.
NOTE : xsd2code community edition 3.4 do not support Vs 2015

Commented Issue: Access Modifiders for Generated Classes [15709]

$
0
0
It would be nice to have an option to choose either internal or public access modifier for generated classes.
Comments: ** Comment from web user: Wibbler **

The ability to set the access modifier of generated classes would be really useful. I have classes being generated in a DLL package that I don't need clients to see (having additional accessible classes around would just confuse them) however there's no way for me to flag them as internal without manually updating all the code in the generated classes to flag them as such.

New Post: Bug: annotations are only emitted to C# when they are for XSD attributes, not for elements, types etc.

$
0
0
See this gist: https://gist.github.com/jpluimers/4247df4e0aa01c1c190a

and this blog post: http://wiert.me/2015/07/22/example-of-xsd2code-only-handling-xsd-annotations-for-attributes-not-for-elements-types-and-other-places-where-they-can-be-used-in-an-xsd/

Example of xsd2code only handling xsd annotations for attributes, not for elements, types and other places where they can be used in an XSD.

Steps to reproduce:
  1. Install xsd2code and Visual Studio.
  2. Put all these files in one directory.
  3. Run generate-C#-from-XSD-annotations.bat.
  4. Diff annotations.xsd.exe.cs and annotations.xsd2code.exe.cs.
  5. Observe only 1 spot in annotations.xsd2code.exe.cs has the annotations converted to C# comments.
--jeroen

Created Unassigned: annotations are only emitted to C# when they are for XSD attributes, not for elements, types etc. [17483]

$
0
0
See this gist: https://gist.github.com/jpluimers/4247df4e0aa01c1c190a

and this blog post: http://wiert.me/2015/07/22/example-of-xsd2code-only-handling-xsd-annotations-for-attributes-not-for-elements-types-and-other-places-where-they-can-be-used-in-an-xsd/

Example of xsd2code only handling xsd annotations for attributes, not for elements, types and other places where they can be used in an XSD.

Steps to reproduce:

1. Install xsd2code and Visual Studio.
2. Put all these files in one directory.
3. Run `generate-C#-from-XSD-annotations.bat`.
4. Diff `annotations.xsd.exe.cs` and `annotations.xsd2code.exe.cs`.
5. Observe only 1 spot in `annotations.xsd2code.exe.cs` has the annotations converted to C# comments.

--jeroen

Commented Unassigned: ReqIF xsd not processable [16331]

$
0
0
When trying to process the reqif.xsd (from http://www.omg.org/spec/ReqIF/20110401/reqif.xsd), the processing aborts (after quite a time) with an error message:

"Error: Reference to undeclared attribute group 'http://www.w3.org/1999/xhtml:xhtml.style.attrib'. Subtype: Unspecified. Rule: "

I did not succeed up to now to find the problem based on this message. There are basically two scenarios:
(1) The problem is caused by the Xsd2Code tool.
(2) The problem is caused by the reqif.xsd (as this is the third version of the standard, I assume this file to be ok, but this may be a wrong assumption).

It would be helpful to get any more information from the tool to get hints for resolving the problem.

This behaviour was experienced with beta version 3.5.1.0.
Comments: ** Comment from web user: nogenius **

Hi!

have you ever found a solution to this issue? I am struggeling with the same problem...

Thanks!

New Post: How to specify the file name?

$
0
0
It's a bigger problem than just that.

Our project standards demand a file per type (not uncommon). We use R# to do this at the solution level to reduce workload.

This renders subsequent use of Xsd2Code extremely fragile, and we had to stop using it on a daily basis.

Our evaluation is this needs a fix, well two;

1 Allow file per type as a config option.
2 Store config outside of the code file, perhaps in its own Xml settings file. I've mentioned this to Pascal before)

Adding a alternative option to allow a single fixed file name choice would help in the original question too.

New Post: How to specify the file name?

$
0
0
Update: its the /O option on the command line. for the original question.

Commented Unassigned: How to create Seperate C# files for Different XSD's [16962]

$
0
0
Hi,
I have around 6 XSD's in my project. One Main Xsd will refer other Xsd's in it. when i generate C# classes using Xsd2Code on the main Xsd, a single C# file is generated with a single Namespace. I want to keep my classes modular and independent of others and use required classes when needed. Is there any way of generating seperate classes with different NameSpace for different Xsd's ? Awaiting your response.

Thanks,
RK
Comments: ** Comment from web user: IainStevenson **

Look at this tutorial;

http://www.liquid-technologies.com/Tutorials/XmlSchemas/XsdTutorial_04.aspx

Then make sure you use the 'Exclude Imported Types' option when generating. Should be the first on the list f options in the UI.

Note: Use xs:Import not xs:Include

New Post: How to force creating empty elements for nullable types

$
0
0
I would like to see an empty node like
<description/>
or
<description></description>
after serialization, but if my description-Property is NULL, the element will not serialized into the XML-file.
What is the correct syntax for my schema?
<xs:element name="Description" type="xs:string" minOccurs="1"/>
does not work.

New Post: Writing out CDATA for string elements?

$
0
0
How can I write out CDATA for string elements?

Created Unassigned: Generating classes in separate files [17554]

$
0
0
I am perfectly with xsd2code++ but I am facing one issue .How Can I generate multiple classes in separate c# files .Right now all the classes are generated in a single file and it sometimes looks messy

New Post: Could not load file or assembly 'System.Core, Version=3.5.0.0,

$
0
0
Hi I'm running xsd2code through command prompt in VS 2013 and getting the following error.
Could not load file or assembly 'System.Core, Version=3.5.0.0,
Is this supported for .net 3.5 only?

Created Unassigned: Element Order and Mandatory elements - not generating corresponding DataMemberAttribute values [17561]

$
0
0
Using latest xsd2Code with Visual Stiudio 2012, I cannot get the code generation to give me
the corresponding DataMemberAttribute values.

For example, I would like the first (Mandatory) element in a sequence to produce a property
with the following attribute:

__[System.Runtime.Serialization.DataMemberAttribute(Order = 1, IsRequired=true)]__

New Post: Is xsd2code++ Abandoned?

$
0
0
I tried downloading xsd2code++ trial. It needs a trial key. The website said it was generated and emailed but never arrived. I wrote support but that email bounced. The site's main announcement page hasn't been updated in 11 months.

Created Unassigned: cannot serialize a derived type [17571]

$
0
0
I have an xsd type A referencing an xsd type B that is extended by several other types (B1, B2, B3, etc.).

After generating the corresponding cs-files (each being in dedicated namspace) I initiate an instance of A refering to a derived type (eg. B1).

However, when I serialize the object instance I get following error:

The type <derived type> was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.

It apperars that I need an attribute (per derived type) on the base class as follows:
[XmlInclude(typeof(DervicedClass))]

How can I enforce the xsd2code tool to set this attribute?
Any ideas?
Viewing all 543 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>