XML Data Sources - getting attributes into the import set

mikeglock
Mega Contributor

I'm trying to import a bunch of xml records generated from deployment tool sas part of a cmdb implementation.

No problem with picking the node (module) I want and creating import set columns for each of the children. However, the name of the module is an attribute of the node and I can't get the xpath filter on the data source definition to pick up the children and the attribute. Any ideas?

xml sample attached. xpath /deploy/module gets the children, how do i also include the name attribute?


Cheers

Mike

2 REPLIES 2

john_andersen
Tera Guru

You can only get element node values from the XML based imports using data sources. Attributes are ignored.

You may have to parse the XML file using a script first at the source and remove attributes to elements before pulling the file into the data source.


mikeglock
Mega Contributor

Suspected as much - problem is these files come from enterprise toolsets so we can't change the output. We'll have to do some pre-processing which is a pain as the xml does meet standards.

Thanks again

Mike