Infopath 2007 from edit field in javascript error unknown namespa

M

Makkus

Hi,

following code snippet works with Infopath 2003 :



//Start the application
var oApp = new ActiveXObject("InfoPath.Application");
WScript.Echo("InfoPath Version: " + oApp.Version);
//Open an InfoPath document from the published template
var oXDocumentCollection = oApp.XDocuments;
var oXDocument =
oXDocumentCollection.NewFromSolution("http://server/Forms/template.xsn";;);
// Get pointers to the target fields
var oID = oXDocument.DOM.selectSingleNode("//ID");


With Infopath 2007 i got the error message unkown name space "My".

I found out that with Infopath 2007 its necessary to declare the used
namespace my.

So how is the last function call with the XMLNAMESPACEMANAGER ??
 
M

Makkus

Hi Bryan,

works fine !!

Thanks a lot,

Markus

Bryan Phillips said:
As a workaround, try using this xpath instead:

//*[local-name()='ID']

This will find all nodes named ID regardless of the namespace they are
in.

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



Hi,

following code snippet works with Infopath 2003 :



//Start the application
var oApp = new ActiveXObject("InfoPath.Application");
WScript.Echo("InfoPath Version: " + oApp.Version);
//Open an InfoPath document from the published template
var oXDocumentCollection = oApp.XDocuments;
var oXDocument =
oXDocumentCollection.NewFromSolution("http://server/Forms/template.xsn";;);
// Get pointers to the target fields
var oID = oXDocument.DOM.selectSingleNode("//ID");


With Infopath 2007 i got the error message unkown name space "My".

I found out that with Infopath 2007 its necessary to declare the used
namespace my.

So how is the last function call with the XMLNAMESPACEMANAGER ??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top