[xsde-users] Prolog items

Jones Chris Chris.Jones at helvar.com
Tue Jan 12 11:39:31 EST 2016


Hi Boris,

Well after a little more playing, yes it looks like a line like (Your first suggestion)
xsde.exe cxx-parser --output-dir "out" --hxx-prologue FRED1 --hxx-prologue FRED2 --namespace-map http://www.w3.org/2001/XMLSchema=XMLEntities "Test1.xsd" "Test2.xsd"

does indeed produce the expected prolog.

And  if you modify that to be:
xsde.exe cxx-parser --output-dir "out" --hxx-prologue FRED1 --hxx-prologue FRED2 --namespace-map http://www.w3.org/2001/XMLSchema=XMLEntities "Test1.xsd" "Test2.xsd"
Your still Ok

This however
xsde.exe cxx-hybrid --output-dir "out" --generate-parser --namespace-map http://www.w3.org/2001/XMLSchema=XMLEntities "Test1.xsd" 
Defiantly gets it wrong...  (Note there's not even a prologue definition)

I'm using a polymorphic XSD, could that be the problem?

Actually I'm using the same test cases we corresponded about before - but for my simple wrong case above just uses the XSD :- (Attached)

<?xml version="1.0" encoding="utf-8"?>
<xs:schema  targetNamespace="http://www.helvar.com/Test1"
            xmlns="http://www.helvar.com/Test1"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
                elementFormDefault="qualified">
    <xs:simpleType name="SubFamily">
        <xs:restriction base="xs:string">
            <xs:enumeration value="Rotary100" />
            <xs:enumeration value="Slider110" />
            <xs:enumeration value="Slider111" />
            <xs:enumeration value="Button121" />
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="EntityTest2">
        <xs:sequence>
            <xs:element name="subFamily"            type="SubFamily"                minOccurs="1" maxOccurs="1"/>         
        </xs:sequence>
    </xs:complexType>
    <xs:element name="EntityTest2" type="EntityTest2"/>
    <xs:complexType name="ProductBaseTest2">
        <xs:complexContent>
            <xs:extension base="EntityTest2">
                <xs:sequence>
                </xs:sequence>
            </xs:extension> 
        </xs:complexContent>
    </xs:complexType>
    <xs:element name="ProductBaseTest2" type="ProductBaseTest2" substitutionGroup="EntityTest2" /> 
</xs:schema>


And it generates test1-pskel.hxx : (some whitespace removed for clarity)


#ifndef TEST1_PSKEL_HXX
#define TEST1_PSKEL_HXX
// Begin prologue.
//
#include <xsde/cxx/hybrid/any-type.hxx>
#include <xsde/cxx/hybrid/any-type-pskel.hxx>
#include <xsde/cxx/hybrid/any-type-pimpl.hxx>
namespace XMLEntities
{
  using ::xsde::cxx::hybrid::any_type;
  using ::xsde::cxx::hybrid::any_type_pskel;
  using ::xsde::cxx::hybrid::any_type_pimpl;
}
//
// End prologue.


Hope this helps

Chris Jones

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: 12 January 2016 16:02
To: Jones Chris
Cc: xsde-users at codesynthesis.com
Subject: Re: [xsde-users] Prolog items

Hi Chris,

Jones Chris <Chris.Jones at helvar.com> writes:

> I'm sorry Borris but the prologs of both the -pskel.h and the -sskel.h
> still do not have correct prologs

This is strange. I tried it myself (albiet on Linux) and it works as
expected. I've also studied the code, and I don't see how it can end
up after.

Can you delete all the generated files to make sure they get regenerated.
Also, can you try:

xsde cxx-parser --hxx-prologue FRED1 --hxx-prologue FRED2 hello.xsd

As well as:

xsde cxx-hybrid --generate-parser --generate-serializer --generate-aggregate \
--hxx-prologue pskel="FRED1" --hxx-prologue pskel="FRED2" hello.xsd

Thanks,
Boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test1.xsd
Type: text/xml
Size: 1307 bytes
Desc: Test1.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20160112/0e9c0802/Test1.bin


More information about the xsde-users mailing list