Re: Question: XSLT Transformation for XSD2FBS

19 views
Skip to first unread message

Wouter van Oortmerssen

unread,
Mar 27, 2017, 1:36:02 PM3/27/17
to Tobias Schönit, FlatBuffers
Like I noted here: http://stackoverflow.com/questions/42998921/xslt-transformation-for-xsd-to-fbs-flatbuffers I do not know that such a tool exists yet.

On Fri, Mar 24, 2017 at 4:14 AM, Tobias Schönit <tobias....@gmail.com> wrote:
Hello,

I have many XML-schematas written in xsd to define the structure of xml documents. Now I want to substitute the format with flatbuffers. When looking at the fbs format it looks possible to convert the XSD Schema definition automatically into a FBS file using XSLT.
As there might be other people that have the same problem I am asking here if there are already some approaches to solve the automatic conversion of XSD Schematas to FBS.

Some examples:
        <xs:complexType name="Configuration">
          <xs:sequence>
                  <xs:element name="MandatoryDetail" type="ComplexConfigDetail" minOccurs="1" maxOccurs="1"/>
                    <xs:element name="OptionalDetail" type="ComplexConfigDetail" minOccurs="0" maxOccurs="1"/>
                     <xs:element name="UnboundedDetail" type="ComplexConfigDetail" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
       <xs:attribute name="MandatoryInt" use="required" type="xs:unsignedInt"/>
         <xs:attribute name="OptionalInt" use="optional" type="xs:unsignedInt"/>
</xs:complexType>
      </xs:complexType>

    <xs:complexType name="ComplexConfigDetail">
        <xs:sequence maxOccurs="1">
                    <xs:element name="Frame" type="xs:int" minOccurs="0" maxOccurs="1"/>
           </xs:sequence>
 </xs:complexType>

Should become
namespace http_www_demo_com_config

table ComplexConfigDetail {
    DetailElement : int;
}

table Configuration {
    MandatoryInt : uint (required);
    OptionalInt : uint;
    MandatoryDetail : ComplexConfigDetail (required);
    OptionalDetail : ComplexConfigDetail;
    UnboundedDetail : [ComplexConfigDetail];
}


Is there such a transformation available as e.g. XSLT. If not should I create a ticket?

Thanks,
Tobias


--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages