Ignoring of a fixed attribute when exporting XML data

Nargalen

New Member
Joined
Oct 5, 2017
Messages
6
Hello,

I'm experiencing a problem with export of XML data from a mapped spreadsheet (MO 2016). Every values that are mapped as per *.xsd file are correctly compiled into a xml file. Unfortunately, the values of attributes that are in *.xsd file set to be fixed do not show up in the resulted *.xml file at all. I've checked the syntax of the code and it's alright. The problematic part of the code follows.

Any help would be greatly appreciated. Does anybody have any idea what is wrong?

Thank you.

Kind Regards,

Jonáš.

Code:
            <xs:element name="file">
                <xs:complextype>
                    <xs:sequence>
                        <xs:element ref="header" minoccurs="1" maxoccurs="1">
                        <xs:element ref="body" minoccurs="1" maxoccurs="1">
                    </xs:element></xs:element></xs:sequence>
                    <xs:attribute name="original" type="xs:string">
                    <xs:attribute name="source-language" type="xs:string">
[B]                    <xs:attribute name="datatype" type="xs:string" fixed="database"></xs:attribute>[/B]
                    <xs:attribute name="target-language" type="xs:string">
                </xs:attribute></xs:attribute></xs:attribute></xs:complextype>
            </xs:element>      
            <xs:element name="header">
                <xs:complextype>
                    <xs:sequence>
                        <xs:element ref="tool" minoccurs="1" maxoccurs="1">    
                    </xs:element></xs:sequence>
                </xs:complextype>
            </xs:element>
                <xs:element name="tool">
                    <xs:complextype>
[B]                        <xs:attribute name="tool-name" fixed="oxygenxml" type="xs:string"></xs:attribute>[/B]
[B]                        <xs:attribute name="autor" fixed="Jonáš Pospíchal" type="xs:string"></xs:attribute>[/B]
                    </xs:complextype>
                </xs:element>
            <xs:element name="body">
                <xs:complextype>
                    <xs:sequence>
                        <xs:element ref="trans-unit" minoccurs="0" maxoccurs="unbounded">
                    </xs:element></xs:sequence>
                </xs:complextype>
             </xs:element>
                 <xs:element name="trans-unit">
                    <xs:complextype>
                        <xs:sequence>
                            <xs:element name="source" type="xs:string">
                            <xs:element name="target" type="xs:string">
                        </xs:element></xs:element></xs:sequence>
                        <xs:attribute name="id" type="xs:float">
                        <xs:attribute name="datatype" fixed="plaintext" type="xs:string">
                        <xs:attribute name="resname" type="xs:string">
                    </xs:attribute></xs:attribute></xs:attribute></xs:complextype>
                 </xs:element>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top