Reference to undeclared namespace prefix : 'dfs' - InfoPath Dev
in

InfoPath Dev

Reference to undeclared namespace prefix : 'dfs'

Last post 12-13-2005 02:54 AM by Coita Thierry. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-12-2005 01:12 AM

    Reference to undeclared namespace prefix : 'dfs'

    Hi,

    I work with InfoPath and JavaScript.

    I have got Form with data source from WSS (name is "sccustomerUpdate").

    When in my code I call this secondary source I have this error : Reference to undeclared namespace prefix : 'dfs'


    However, I change data source view :

    XDocument.DataObjects.Item("sccustomerUpdate").Query();
    var try = XDocument.GetDOM("sccustomerUpdate");
    XDocument.UI.Alert(try.documentElement.selectSingleNode("/dfs:myFields/dfs:dataFields/dfs:sccustomer/@PAM").Text);


    How can I do ?

    Thank for you help.


    Michel DEGREMONT.
  • 12-12-2005 04:45 AM In reply to

    Re: Reference to undeclared namespace prefix : 'dfs'

    Hi (Salut),

    Welcome on board!

    I have the code for c# :

    try.setProperty("SelectionNamespaces", "xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"");


    but I think it's a things like this for Jscript:

    try.setProperty("SelectionNamespaces", 'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"');



    Bonne Chance

    ++

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 12-12-2005 06:38 AM In reply to

    Re: Reference to undeclared namespace prefix : 'dfs'

    Haha, I ran into this error when I started with InfoPath too, it took so long to figure out what was going on! It happened to me and by the looks of it to Michel because of copying from code examples and tutorials without really knowing what was going on. Anyway, here's further reference for namespaces:

    http://www.w3schools.com/xml/xml_namespaces.asp

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 12-13-2005 12:38 AM In reply to

    Re: Reference to undeclared namespace prefix : 'dfs'

    Hi,

    Thanks for your help. I didn't have this error, however, infoPath return me empty string whereas I should have a value.

    I wrote :

    var nodeCustomer = eventObj.Source.nodeValue;
    XDocument.UI.Alert(nodeCustomer);//return a good value

    XDocument.DataObjects.Item("sccustomerUpdate").Query();
    var myList = XDocument.GetDOM("sccustomerUpdate");
    myList.setProperty("SelectionNamespaces", 'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"');
    XDocument.UI.Alert(myList.selectSingleNode("/dfs:myFields/dfs:dataFields/dfs:sccustomer[@Title='" + nodeCustomer + "']").Text); // return empty string


    Some body has an idea ?



    Michel DEGREMONT.
  • 12-13-2005 02:54 AM In reply to

    Re: Reference to undeclared namespace prefix : 'dfs'

    Salut,

    Are you sure that the namespace is always the same for:

    XDocument.UI.Alert(myList.selectSingleNode("/dfs:myFields/dfs:dataFields/dfs:sccustomer[@Title='" + nodeCustomer + "']").Text);

    I think it's tns: not dfs for this one!

    ++

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.