Xpedition Xpedition EDM Library: XML Console Query Restriction Tag Errors with “entity name must immediately follow the '&'”

2024-11-06T15:04:44.000-0500
Data Management Schematic Capture

Summary


Details

Using this Library Cockpit search as an example to find part numbers without (~) “HOLE” and (&) without (~) “Hole” in the value …


 
… the same search string in an XML Query File …

<?xml version="1.0" encoding="UTF-8"?>
<export>
  <object class="001" dynamic="true" noninputfields="false" comments="true" broken_ref="true">
    <restrictions>
      <restriction path="001obj_id" value="~*HOLE*&~*Hole*" />
    </restrictions>
  </object>
</export>


… results in an error:

Reason: Could not parse XML query file: Exclude.xml. 
Reason: Error on line 6: The entity name must immediately follow the '&' in the entity reference.

Errors occurred during export. No output was created.

The reason for this error is the ampersand character, ‘&’, has a special meaning in XML files and cannot be used as a literal character. The & character must be escaped with either a numeric reference (&#038;) or the string “&amp;”:

<?xml version="1.0" encoding="UTF-8"?>
<export>
  <object class="001" dynamic="true" noninputfields="false" comments="true" broken_ref="true">
    <restrictions>
      <restriction path="001obj_id" value="~*HOLE*&amp;~*Hole*" />
    </restrictions>
  </object>
</export>

 
Please refer to this Table of ASCII Codes, Characters and Symbols for all of the special characters (Symbol column) and their equivalent HTML Number (e.g.: &#038;) and, if they have one, the HTML Name (e.g.: &amp;)

Additionally, these Xpedition EDM documents explain Search String Formats for EDM Library Cockpit and XML Query File Tags:

KB Article ID# KB000155401_EN_US

Contents

SummaryDetails

Associated Components

Xpedition EDM Server Utilities Xpedition EDM Library Cockpit