Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

small help/explanation how to continue with creation of xml

Status
Not open for further replies.

kostek75

Programmer
Aug 3, 2016
1
PL
Hi there,

I'm facing with the following problem. I am creating xml file using VBA (simple print to file). One tag I have is described in the following way:

<FileAttachment> common:FileAttachment_Type </FileAttachment> [0..1] ?

where FileAttachment_Type is defined

<xs:complexType name="FileAttachment_Type">
<xs:sequence>
<xs:element name="FileType" type="vr:FileType_Type"/>
<xs:element name="FileName" type="xs:token"/> 'token changed to string in newer version
<xs:element name="FileDescription" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

and FileType_Type is defined

<xs:simpleType name="FileType_Type">
<xs:restriction base="xs:string">
<xs:enumeration value="application/pdf"/>
<xs:enumeration value="image/jpeg"/>
<xs:enumeration value="image/tiff"/>
<xs:enumeration value="application/zip"/>
</xs:restriction>
</xs:simpleType>

The xml part I have is:
<FileAttachment>
<FileType>application/pdf</FileType>
<FileName>C:\Users\xyz.xyz\Desktop\abc.pdf</FileName>
<FileDescription>xyz</FileDescription>
</FileAttachment>

but this syntax is wrong. I get message from the system: The file referenced in the XML file in FileAttachment/FileName does not exists in the loaded zip file.

Can somebody give me a hint what could be wrong?

Thanks in advance.
TK.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top