apoc icon indicating copy to clipboard operation
apoc copied to clipboard

Add an option to apoc.load.xml to add the element prefix in '_prefix' instead of only the local element name in '_type'

Open kvegter opened this issue 1 year ago • 1 comments

Feature description

Add a configuration parameter for including the element namespace '_prefix' as a property besides '_type' and '_children'.

Considered alternatives

There is no neo4j procedure alternative. To solve this we had to use an xpath query to get all the local names for a given namespace. But then we loose the exact information available in the xml. There can be overlap in local names for classes and members (see below). Also this requires two times parsing the same xml document.

How this feature can improve the project?

The reason for this for parsing xml structures which are in this case a dump of classes. For example there is a namespace for classes 'xc:' and for members of those classes 'xm:' for example:

<xs:Book>
  <xm:name>bookname</xm:name>
  <xm:title>a title</xm:title>
<xs:Book>

This is a simple example. The real example has about 2600 different 'xs: elements'

kvegter avatar Nov 15 '23 08:11 kvegter