Pictures in an XML-file? - InfoPath Dev
in

InfoPath Dev

Qdabra® Training

Use our Google Custom Search for best site search results.

Pictures in an XML-file?

Last post 05-11-2011 01:00 AM by Joern. 18 replies.
Page 1 of 2 (19 items) 1 2 Next >
Sort Posts: Previous Next
  • 01-24-2011 03:52 AM

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Pictures in an XML-file?

    Hello All,

    I want to create a season schedule with all fixtures. Additionally, I want to show the emblem of each team.

    The user can choose the matchday from a dropdown-field and then the fixtures are shown in several textfields. Currently, I have insert a picture with a certain emblem - with the rule that the picture should be hidden when the corresponding team is NOT shown.

    Since I have 18 teams and 9 fixtures each matchday I have to insert 324 emblems, which is not that smart.

    Therefore, I would like to get the corresponding emblem via data connection to a XML-file.

    But how can I put pictures in a XML-File?

    Thank you in advance for your efforts and many greetings from Germany.

     

  • 01-24-2011 08:55 AM In reply to

    Hey there:

    I'd try encoding the image as a base 64 binary string, then saving that in my XML file. You can find tools online that will encode / decode base 64. After adding the XML as a secondary data connection to my form, I'd save the form as source files and modify the data connection schema to ensure the data type for my "emblem" field is base 64.

    Including a sample -- right click on the link in the header to save locally, then right click the saved file to open in design mode. Preview to see the functionality.

    Hilary Stoupa

  • 01-24-2011 09:47 AM In reply to

    Re: Pictures in an XML-file?

    You can also create and use a separate InfoPath form to produce your XML with a repeating group containing pictures and their related data, then save out and use that XML as your secondary data source.  You will probably still need to modify the 2ds schema in your main form to indicate the field as base64, like Hilary says.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-25-2011 06:17 AM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Pictures in an XML-file?

    Hi,

    thank you very much for your quick response.

    Well, so far I did it the way, Jimmy proposed. But how do I modify the 2ds schema?

    Sorry, but I'm absolutely not familiar with XML-programming. *blushing*

    Thank you very much in advance.

  • 01-25-2011 08:54 AM In reply to

    Re: Pictures in an XML-file?

    After you've added the file as a 2DS, save out the form as its source files, locate those files, and use a text editor to open the .xsd file with the name of your 2DS.

    Locate the <xsd:element> node with a name= attribute that corresponds to your picture field, and change the type= attribute to xsd:base64Binary

    Resave the file, right-click manifest.xsf, and select Design.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-25-2011 11:50 PM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Pictures in an XML-file?

    When I right-click manifest.xsd and then select Design InfoPath opens and I get the message like "InfoPath can not open the form. The ...(.xsf) is containing an error."

    In Detail: "The .xsf file refers to the file 'myschema.xsd', but this is not included in the from"

     What am I doing wrong?

    Many thanks for your support and patience. :-)

  • 01-26-2011 12:33 AM In reply to

    Re: Pictures in an XML-file?

    Did you delete or rename any of the files that were extracted from your form?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-26-2011 12:50 AM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Pictures in an XML-file?

    Well, I can try to describe what I did: 

     

    After I have made the changes in the .xsd file of my 2DS, I saved it. Then, when I want to close the .cab file of my form I am told that a file was changed since I extracted the file from my form and I am asked if I want to delete it to see the archive.

    When I click 'No, I don't want to delete it', I cannot open the .xsd file again. 

    But when I press 'delete', I do not see my changes in the .xsd file of my 2DS.

    Thus, I assume that my changes are not even saved.

    Then, I am trying to open the manifest.xsf

     

     

  • 01-26-2011 02:22 AM In reply to

    Re: Pictures in an XML-file?

    You should extract the CAB to a folder on your hard drive and edit the contents there. Trying to edit the files while still inside the CAB is a bad idea.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-26-2011 02:39 AM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Sorry, I won't made it. I simply do not understand, since I still cannot open the manifest.xsd

    Now, I attached the .xml form with the teams and emblems.

    Would it be possible and if so, may I kindly ask you to add this form to a new blank form and to make the changes you've proposed?

    It would be so much help for me and I would realy appreciate it.

    Thank you very much in advance.

  • 01-26-2011 03:34 AM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Pictures in an XML-file?

    Thank you so much.

    Unfortunately, now I have the problem that I use InfoPath 2003 and you have created the form with a newer version....I'm sorry...

  • 01-26-2011 04:46 AM In reply to

     

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-26-2011 05:23 AM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Pictures in an XML-file?

    Super cool. Now it works.

    Thank you so very much. You saved me lots of time spending on to do this with pictures I have to hide and show depending on what team is selected.

    Once again, thank you so much *both thumbs up*

    By the way, are you in Australia?

  • 01-26-2011 06:00 AM In reply to

    Re: Pictures in an XML-file?

    Glad to help.  I'm in Japan.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-26-2011 06:06 AM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Pictures in an XML-file?

    Cool. I just saw the system time in your .cab file and was suprised that it was later than here in Germany. I'd rather expected you to be in the US... :-)

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