Mapping xml data to the html formatting - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Mapping xml data to the html formatting

Last post 11-06-2012 05:56 AM by sarajday. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • 10-18-2012 12:23 PM

    Mapping xml data to the html formatting

    Hi All,

     I have the raw xml format of a browser enabled infopath form. I am trying to map the xml to the html formatting from the browser enabled form. In other words, how can we relate the xml to how it is displayed in the html? Trying to read the xml in code, then spit it back out into another format using the original html formatting from the form. Any ideas?

    Thanks

    Laby

  • 10-18-2012 12:27 PM In reply to

    Re: Mapping xml data to the html formatting

    I think what you are missing are the InfoPath processing-instructions. If you open your InfoPath form and use File > Save As and save an XML file, you can then open the file with a text editor. You'll see at the top some processing-instructions that start with <?mso-infoPathSolution PIVersion="1.0.0.0"  etc....
    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 10-19-2012 07:47 AM In reply to

    Re: Mapping xml data to the html formatting

    Thanks Hilary. I saved as .xml from infopath, but the file looks like below when opened in notepad?

    [f     D                   [f Р         À  v   =        SA²U  manifest.xsf ÷
       =    QA„  BuiltInActiveXControls.xsd B   H    RA a  view1.xsl Ž„  BH   RAï`  upgrade.xsl Äa  ÐÌ   RAï`  sampledata.xml  P  ”.   RA²  commisionDiscForm.dll W"  ”~   RAï`  myschema.xsd ld  ë    SA²U  template.xml "  W   QA„  A7D88B80.png r  s'   QA„  8F050A97.png  >  å(   RA²  commisionDiscForm.pdb  7 åf   RA²  itextsharp.dll u"’bþ €CKä<ûoÛ8“?öà¹Ø[`¿òTšÝsb§5.¯‹¶{(Ðë*‰ZINbýßo†¤(Ê–ÛqvÛÛÛµH΃ÃyqHéíGîY»<8ª4¶ê›;npwT¹œV÷+¿ÿöÓ«·ÿQ­þôj0vc2r=Fàÿt’pŸ&®M=oJìˆÑ„9„ñ|äÂÃpJÎ];â1%¤ŒøMÆ[?½:ÓàŽÅħ# 'ɘI´|’Ä.´ñ‘N|÷nœ!#âŽähù$a~èUäFÓt“RµŠÌ?Æ#ë±Ãí‰Ï‚äÄ£qLbîM˜ó) ¢É‡T ­­:þ­èþ†hàoc{§Bˆ;;jlK˜ˆý9q#v:ñ¼A4‰“£Ê”ÅPŸU&Q`Åö˜ù4®ú©Pª6÷->¹6³\à:®-hó]ÄÜqcù«ÂYUú©ß©6ëfµQ¯Ö½êv³ZG†&CύÇ7‘wT9±>;ìžy<ÄÉ~žC¶ȶã BàG[ ›£Ê8IB«VSümiþ¶ ¼&ù«¥üÕšõz«–ʧÃFnàâ/asuŒ»kì1a2È[«#?X¹?ÆÞ¢•‚îDsâ¬!¶l®†~xxØzhmñè‡4jŸÎÏúaÕ
    â„6ËHÞ$®·Îj!ã5ÎP}Jíam|Ú¢2¤ç0bm|œ¡ê€a¯

  • 10-19-2012 08:02 AM In reply to

    Re: Mapping xml data to the html formatting

    ok, I have the xml, so what do I need to look for here to map it back to the html formatting:?:

    <?xml version="1.0" encoding="utf-8"?>
    <?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:frm3:-myXSD-2012-09-19T15-38-02" solutionVersion="1.0.0.611" productVersion="14.0.0.0" PIVersion="1.0.0.0" href="http://mydev.sepro.com/personal/told/frm3/Forms/template.xsn"?>
    <?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.3"?>
    <my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:d_1="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2012-09-19T15:38:02" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-US">
     <my:txtrecvngdistname></my:txtrecvngdistname>
     <my:txtdaystrvl></my:txtdaystrvl>
     <my:dtarrival xsi:nil="true"></my:dtarrival>
     <my:dtcheckout xsi:nil="true"></my:dtcheckout>

  • 10-19-2012 08:21 AM In reply to

    Re: Mapping xml data to the html formatting

    The processing instructions are what tell the XML to open with the InfoPath form - I am guessing that is what you mean by "map it back to the html formatting" - if that is not what you mean, please clarify.

    The processing instructions in the above XML are:

    <?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:frm3:-myXSD-2012-09-19T15-38-02" solutionVersion="1.0.0.611" productVersion="14.0.0.0" PIVersion="1.0.0.0" href="http://mysitedev.searshomepro.com/personal/toldro/frm3/Forms/template.xsn"?>

    The href contains the location of the form template. You can test this by adding these manually to an XML file with the same schema, then trying to open it by double clicking.

    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 10-19-2012 12:38 PM In reply to

    Re: Mapping xml data to the html formatting

    Thanks Hilary. What do you mean by " adding these manually to an XML file with the same schema"?

    Thanks

  • 10-19-2012 12:48 PM In reply to

    Re: Mapping xml data to the html formatting

    You originally said:

    I have the raw xml format of a browser enabled infopath form

    I don't know what "raw xml format" is - but I was guessing you mean that you have .xml files with XML in them that are not associated with an InfoPath template. You could try them with your template by manually adding the processing instructions, saving the file and then trying to open it. Does that make sense? Or am I misunderstanding what you are attempting to do?

    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 10-19-2012 01:05 PM In reply to

    Re: Mapping xml data to the html formatting

    I think I'm getting a little off track here. I have the .xml file that is associated with a form template which is in my above post. What I would like to do is save the form in .html format once form is completed. I'm not sure if i need the .xml extracted first to write into a .html format. The form is browser enabled. Perhaps using "XslCompiledTransform" would work?

    Thanks

  • 10-19-2012 02:19 PM In reply to

    Re: Mapping xml data to the html formatting

    Yup, I did not understand what you were getting at - sorry about that!

    Your template is a cab file - there are XSLT files in there you could use for this. You can export your source files for the template and then you'd have the XSLT.

    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 10-19-2012 02:34 PM In reply to

    Re: Mapping xml data to the html formatting

    Ok, Sounds good. I exported all files and placed them into the Layouts directory under the 14 hive. I will get at this again on Monday. Any other information you could provide me with getting started?

    Thanks

  • 10-19-2012 03:09 PM In reply to

    Re: Mapping xml data to the html formatting

    No - I've not done this before - I'm perplexed as to why you'd want to, honestly. You might want to provide more information on your intended design, in case someone else has some ideas.
    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 10-19-2012 09:51 PM In reply to

    labyrinth248:
    What I would like to do is save the form in .html format once form is completed
     

    You did not provide any concrete details, And there are quite a plethora of books and online tutorials for introduction to Sharepoint and Infopath architecture/paradigm/philosophy. 

    Infopath forms are XML based and basically just provide XML data for their use (rendering of forms and XML data in them) by other tools, frameworks, services, packages, etc.
    Also and mainly they are used EXTERNALLY (by external "tools").

    And Infopath Designer is not web  development tool (or HTML editor, creating/changing/updating/mapping HTML), it is  XML (forms) editor for creating forms to be used in many possible formats, in many contexts externally. 

    For example, HTML (webpage) is generated by Infopath Form Service which is the enterprise feature of Sharepoint Server 2010 from Infopath XML data form and linked to it Infopath XSN form template.

     The latter is stored, registered and used on Sharepoint Server site as precompiled Infopath Web Part (object).

    If you are not going to reverse  engineer and hack Sharepoint Server, then you should use the same tools and functionalities provided by them through which you generate(d) "HTML" webpage and/or  from their context (External to Infopath form editing/creation).
    There you most probably will see a violet icon of (compiled) Infopath Form Web Part (generated from published IP template) with contextual options "Edit Web Part" and "Add a Web Part" link.

    Through the latter you can embed built-in and previously deployed/published to Sharepoint Server site web parts (incl. Infopath Form Web Parts).
    Upon adding another web part, you should see contextual choice Connections with subchoices depending on how and what you use with, for example:

    • Send Table To
    • Send Row of Sata To
    • Get Parameters From
    • Get Filter Values From 

    You should look into how to use what is provided by a "platform" first instead of trying to subvert (substitute, overrrun or overcomplicate) what is provided OOTB


    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 10-22-2012 05:46 AM In reply to

    Re: Mapping xml data to the html formatting

    Thanks for your reply Gennady. Our ultimate goal is to have infopath browser based forms be converted to either htm or pdf formats once the forms are submitted to a forms library. Instead of purchasing a 3rd party tool for this such as "muhimbi", I was trying to accomplish this with my own knowledge first. I have  logic in place on a forms code behind that does convert each object on the form to a pdf format, but its only specific for that form. I was trying to implement this as a more universal feature that could be re-usable on other forms. Does anyone have any experience with this? I was thinking making an custom action in SPD that when selected in a forms workflow, it would disect the form, then reformat to pdf, but the hard part will be coding it so that any form can be used with this action.

    Thanks

  • 10-22-2012 06:43 AM In reply to

    Re: Mapping xml data to the html formatting

    labyrinth248:
    Thanks for your reply Gennady. Our ultimate goal is to have infopath browser based forms be converted to either htm or pdf formats
     

    Just yesterday I run the code from this thread that exported an Infopath form to Pdf, without any problems

    Though it seems to be available to do without any coding in File > Info > Form Options > Filler Features >  Export to PDF or XPS


    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 10-22-2012 07:43 AM In reply to

    Re: Mapping xml data to the html formatting

    Gennady Vanin (Геннадий Ванин, Новосибирск):

    Just yesterday I run the code from this thread that exported an Infopath form to Pdf, without any problems

    Gennady - was this filler or web based form that you tried? Looking to do this in browser form only and not filler.

    Thanks

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