Problem with the 'my:' namespace in Infopath 2003 - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Problem with the 'my:' namespace in Infopath 2003

Last post 09-05-2007 05:42 PM by 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-03-2007 11:30 PM

    Problem with the 'my:' namespace in Infopath 2003

    Hi, I'm having some problems with the namespace in Infopath 2003. Can someone please help..

    It's a very complicated form with 10 views and around 150 data sources.

    My problem is all these data sournces are in 'mstns:' namespace, but someone has just stuffed up something in the form, and all the new data sources I'm trying to create automatically get assigned to a 'my:' namespace. And they don't work properly like others.

    var root = _XDocument.DOM.selectSingleNode("/mstns:Workflow");
    root.selectSingleNode("my:customerName").text = currResult.custName;

    The above code gives javascript error where the code could not get "my:customerName" node.

    However if I try to assign something to an existing data source which belongs to the existing namespace 'mstns:' like following, it works fine.
    root.selectSingleNode("mstns:customerID").text = currResult.custID;

    Could someone please let me know how to get the old namespace back, so the new datasource I create will belongs to the old namespace 'mstns:'

    Thanks alot!!

  • 09-05-2007 03:24 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Problem with the 'my:' namespace in Infopath 2003

    Hi Kris Welcome to the forums,

    Here is “my” and 'mstns' are name space prefix of your form. By default InfoPath gives us name space prefix is “my”. If you want to change the prefix of namespace in your form then directly change into script.vbs or script.js file. In this file on top the line you have to change:

    XDocument.DOM.setProperty "SelectionNamespaces", "xmlns:my="""""

    Above bolded prefix name place you can change the prefix name whichever you want it.

    Hope this helps you

  • 09-05-2007 05:42 PM In reply to

    Re: Problem with the 'my:' namespace in Infopath 2003

    Hi Shiva,

     Thanks! I think I tried that and it didn't work. But I'll give it another try next week, and I'll get back to you if I'm getting any problems:D



Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.