Opening an existing form after a change in namespace - InfoPath Dev
in

InfoPath Dev

Opening an existing form after a change in namespace

Last post 01-31-2008 01:21 PM by Greg Collins. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-28-2008 09:15 PM

    • anujQA
    • Not Ranked
    • Joined on 08-02-2007
    • Posts 9

    Opening an existing form after a change in namespace

    Hi,

    I have an infopath form whose namespace has changed. I mean the target in xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-08-23T15-52-08" has changed.

    If my versioning setting is set to "Automatically upgrade existing forms", the existing forms are upgraded and my entire data is lost. I get a blank new form.

    Hence, I changed my setting to "Use custom event" and wrote some code for changed nodes.

     But if I try to open existing forms, I get a message "The element '{http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-08-23T15-52-08}XYZ' is used but not declared in the DTD/Schema."

    I can get rid of this problem if I manually update the target in xmlns:my=""

    But I want the namespace to be updated automatically when I try to open an exisiting form.

    Please let me know if there is a solution to this problem.

    Hope any one can help.

    Thanks,

    Anuj Chaudhary

  • 01-29-2008 11:56 AM In reply to

    Re: Opening an existing form after a change in namespace

    The big question is why did you change the namespace definition? If you extract the form files, you can find all references to the namespace and change it back to the original, and then you shouldn't have any issues like this with the form.

    Was there a legitimate reason for the namespace definition change?

  • 01-29-2008 10:29 PM In reply to

    • anujQA
    • Not Ranked
    • Joined on 08-02-2007
    • Posts 9

    Re: Opening an existing form after a change in namespace

    Not really sure, how did the namespace change. I think when I changed the schema, the namespace might have changed at that time. I want to point point that the namespace didnt change completely. Only the date time part "2005-08-23T15-52-08"" at the end of the namespace has changed.

    It wont be possible to change the namespace back to the original. I would have to do it manually everywhere. This doesnt seem to be a good idea.

    Is there a way so that I can update the namespace in already existing forms through code?

    Thanks,

    Anuj Chaudhary

  • 01-30-2008 04:21 PM In reply to

    Re: Opening an existing form after a change in namespace

    That's the date/time stamp for the namespace. That would make sense.

    You will need to do it manually. There are a minimal amount of places in your form template files that will require the name change. You can use the command prompt program "findstr" to identify which files. For example, from the command prompt:

    c:\MyExtractedFormFiles>findstr /m "2008-01-18T20:57:22" *.*
    manifest.xsf
    myschema.xsd
    sampledata.xml
    template.xml
    view1.xsl

    The /m paramter says to just show filenames. With this list, you can do a search and replace to put the namespace definition back to its original.

    ** AS ALWAYS: Backup your form template before doing any manual changes **

  • 01-30-2008 09:47 PM In reply to

    • anujQA
    • Not Ranked
    • Joined on 08-02-2007
    • Posts 9

    Re: Opening an existing form after a change in namespace

    Ok Thanks Greg for your help.

    So I will have to change the Date time stamp manually every time there occurs a schema change :(

  • 01-31-2008 01:21 PM In reply to

    Re: Opening an existing form after a change in namespace

    No. Namespace definitions don't chnage just because you make schema changes. This kind of change happens when you do something more significant... like "swap out" the schema, or create a new form template based on an old one. Just adding/renaming/removing schema elements/attributes will not change your namespace definition.

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