Salesforce

XML Troubleshooting (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

XML Troubleshooting (Magic xpa 3.x)

Q1

How come when I have a restriction element Magic xpa can’t always use the schema with XML views?

A1

Delete the part with the restriction (the <xs:restriction> tag).

For example, if you have:

<xs:element name="description">

<xs:simpleType>

<xs:restriction>

<xs:maxLength value="256">

</xs:restriction>

</xs:simpleType>

</xs:element>

Change it to:

<xs:element type="xs:string" name="description">

</xs:element>

In addition, in Magic xpa's table definition, go to the Magic xpa fields and add the limitation described in the restriction tag. In the example, update the picture to 256.

Q2

Why am I getting the "Row length too big" error for an XML view (default database=Memory) with a record size of over 32K (32768 bytes)?

A2

The length and the limitation depends on the XML database defined. If you require more than 32767 bytes, work with MSSQL or another database.

Q3

Why am I getting the "Fatal: invalid document structure" error?

A3

This may happen when the encoding of the XML does not match the encoding of the file created by the File2Blb function. To solve this, try defining an Ansi BLOB to put the File2Blb data into and use it with the XMLValidate function.

Q4

Why am I getting the "XSD has a different target namespace from the one specified in the instance doc" error?

A4

This may happen when the XMLValidate function is not used correctly. To solve this, check to see that the parameters of the function are set correctly. For example, if the schema has a targetNamespace, the 2nd parameter (if specified) must have the target namespace prefixed before the schema location, separated by a space.

Q5

When I try to parse XML files using XML functions, why is the parsing failing?

A5

This might happen with XML functions, such as XMLGet and XMLExist, when you use single quotation marks in the XML function's XML declaration, such as <?xml version='1.0' encoding='UTF-8'?>.

There are a number of solutions:

  1. Change the single quotation marks to double quotation marks, such as <?xml version="1.0" encoding="UTF-8"?>.

  2. This occurs sometimes when a BLOB is defined as Unicode, but works okay with ANSI. Therefore, you can try defining the BLOB as ANSI.

  3. Use the File2Blb function to convert the XML file into a Binary BLOB and then use the UnicodeToANSI function with a utf-8 codepage as the second argument.

Reference
Attachment 
Attachment