SharePoint Columns Don't Use Real XPaths to Get Their Data - Patrick Halstead
in

InfoPath Dev

Patrick Halstead

SharePoint Columns Don't Use Real XPaths to Get Their Data

Suppose you have a schema with the following structure:

myfields
    ns1:coolDocument
        coolField
    ns2:coolDocument
        coolField

When you save your form to SharePoint, if you select to promote both coolField entries, then the promotion will fail for the 2nd entry (actually, it will read the first entry instead of the second).

The reason this happens is because SharePoint XML parser doesn't support namespaces, so the pseudo xpaths are actually just /myFields/coolDocument/coolField, i.e. there's no ns1: prefix. That means that the second column will extract the value from the first coolField.

More details: the SharePoint XML parser completely ignores the namespaces and has no support for XPath. This is why the XFP uses the name “node“ for the attribute versus XPath. It is not really an XPath but rather a list of element names separated by slashes.

WORKAROUND:

Don't use or promote elements with the same name if they have different namespaces.

Comments

No Comments

About Patrick Halstead

Hello! I am the founder of Qdabra Software, a small bootstrap software company focused on electronic forms for customers of all stripes. We help organizations design and implement solutions using off-the-shelf technologies such as Office 365, SharePoint and InfoPath. We help you build form solutions in the cloud or on premises. My hobbies include running, hiking, independent film, and Japanese culture.
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.