extract the field names from the xml of an infopath form - InfoPath Dev
in

InfoPath Dev

extract the field names from the xml of an infopath form

Last post 02-12-2012 04:39 AM by Skarn. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-23-2012 12:06 AM

    extract the field names from the xml of an infopath form

    Hello,

    I need to dynamically extract the field names of my xsn form. I have the xml of the infopath form stored in a CLOB column.

    My xml in the CLOB column is somthing like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:PD-WD-Form1-124:-myXSD-2010-10-20T09-36-58" href="manifest.xsf" mce_href="manifest.xsf" solutionVersion="1.0.0.1" productVersion="12.0.0" PIVersion="1.0.0.0" ?>
    <?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?>
    <my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-10-20T09:36:58">
     <my:WDComment></my:WDComment>
     <my:field2></my:field2>
     <my:field3></my:field3>
    </my:myFields>

    so i need values like

    myFields/WDComment/nestedfield2 - (if any)

    myFields/field2

    myFields/field3

    Can you please help?

  • 01-24-2012 10:55 AM In reply to

    Re: extract the field names from the xml of an infopath form

    I think what you need is the schema file which is the XSD.  All of the InfoPath file format specifications are documented by Microsoft and can be found here: http://msdn.microsoft.com/en-us/library/cc313124(v=office.12).aspx

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

  • 02-12-2012 04:39 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: extract the field names from the xml of an infopath form

    To get the specific kind of structured output you have provided the example for (parent\child\grand-child) etc you'll probably have to load the xml file into an XML DOM of some sort and 'walk your way' through it iteratively building the path to each node-field as you go. You could use the nodeName properties.

    This kind of iteration I usually use two functions, one to start off the routine, and the other as a recursive processing of a node which calls itself.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.