IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: szi
About
User Name: szi
Forum Rank: Newbie
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Friday, March 6, 2020
Last Visit: Tuesday, August 4, 2020 12:01:22 PM
Number of Posts: 3
[0.02% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: XSD export to Postgresql
Posted: Tuesday, August 4, 2020 11:59:55 AM
I tried to export a XSD to Postgres. But the generated database is completely useless.

First the XML data type xsd:string gets converted to bit(1).

Second my schema has a structure. Delivery has two child nodes: Header and Item.

Code:

    <xsd:element name="Delivery" type="tns:DeliveryType"/>

    <xsd:complexType name="DeliveryType">
        <xsd:sequence>
            <xsd:element name="Header" type="tns:DeliveryHeaderType"/>
            <xsd:element name="Item" type="tns:DeliveryItemType" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="DeliveryHeaderType">
        <xsd:sequence>
            <xsd:element name="VendorID" type="xsd:string"/>
            <xsd:element name="DeliveryNbr" type="xsd:string"/>
            <xsd:element name="DelvDate" type="xsd:date"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="DeliveryItemType">
        <xsd:sequence>
            <xsd:element name="ItemDescr" type="tns:DeviceDescriptionType" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="DeliveryItemNbr" type="xsd:string"/>
            <xsd:element name="Quantity" type="xsd:float"/>
            <xsd:element name="Unit" type="xsd:string"/>
            <xsd:element name="SecunetMaterialNbr" type="xsd:string" minOccurs="0"/>
            <xsd:element name="VendorMaterialNbr" type="xsd:string"/>
            <xsd:element name="SecPONbr" type="xsd:string"/>
            <xsd:element name="SecPOItm" type="xsd:string" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>


XMLSpy generates for the above XML two tables:

Code:

CREATE TABLE public."Header"
(
    "VendorID" bit(1) NOT NULL,
    "DeliveryNbr" bit(1) NOT NULL,
    "DelvDate" character varying(255) COLLATE pg_catalog."default" NOT NULL
)

CREATE TABLE public."Item"
(
    "DeliveryItemNbr" bit(1) NOT NULL,
    "Quantity" real NOT NULL,
    "Unit" bit(1) NOT NULL,
    "SecunetMaterialNbr" bit(1),
    "VendorMaterialNbr" bit(1) NOT NULL,
    "SecPONbr" bit(1) NOT NULL,
    "SecPOItm" bit(1)
)


But I can not see any relation. How to know that a deliver item belongs to a delivery?

I have no idea how this could ever work.

How to fix this?
Topic: How to parse a standard US data string?
Posted: Thursday, April 9, 2020 11:17:56 AM
I have a string field with a standard US date using abbreviated months.

Example: Dec 3 14:28:51 2019 GMT

How can I parse this date in order to convert it into a different format?
Topic: Generate Java code
Posted: Friday, March 6, 2020 1:54:56 PM
When I generate Java code from an mapping, MapForce writes the filename of the example directly into the main function:

Code:
com.altova.io.Input Defekte_RZK_Lieferung2Source = com.altova.io.StreamInput.createInput("edn-75450 - Kopie.xml");
com.altova.io.Output RZK2Target = new com.altova.io.FileOutput("RZK.csv");


How do I have to define the model, so that the file name is variable and taken from the command line?

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.