XML file explanation - InfoPath Dev
in

InfoPath Dev

XML file explanation

Last post 04-14-2011 05:03 AM by Skarn. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-15-2011 04:58 PM

    XML file explanation

     hi, i have created a infopath 2007 form that get data from a sql server database

    know on curiosity i saved the form as source files.

    now i'm looking at the files.

    and i'm not a xml file reader. so there are some terms i want to know if someone can explain to me.

    the xml code is like this:

    <xdado><dfs:dataFields xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution">
        <d:TABLE_NAME xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" TABLE_NAME_CODE="1" FIELD_NAME="Business Outing"/>
        <d:TABLE_NAME xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" TABLE_NAME_CODE="2" FIELD_NAME="Illnes"/>
    </dfs:dataFields></xdado>

    i want an explanation on the: <xdado><dfs:, <d:and the </dfs:dataFields>

     

    with this code, in my form it is a drop down list where the user can choose between Business Outing and Illness

     

    can someone help me with this 

    thnx!

    Filed under: , ,
  • 03-21-2011 10:51 AM In reply to

    Hi:

    Which of the source files are you referring to? Is this in an xsl?

    Hilary Stoupa

  • 04-14-2011 05:03 AM In reply to

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

     <xdado> - is just the root node of the XML file, like <HTML> tag in a webpage.
    Notice the closing node at the end </xdado> at the end of the file

    <dfs:, <d: - ok, so XML files you may have seen might not have seen these letters/characters followed by colon before the node name.
    These are called namespaces and provide another way for sets of XML nodes to be 'grouped' or related to one another and therefore referenced.

    An XML file might contain multiple namespaces to distinguish sets of nodes.

    The </dfs:dataFields> is just the closing tag for the 'dataFields' XML node of the dfs namespace.

    Namespaces can be horribly lengthy things, usually something that resembles a website address, and I think is meant to convey the 'schema' (or structure) that the XML nodes following are expected to be based on. But because having http://blahblahblah in front of EVERY node would be insanely hard to read, shorter names are defined by the xmlns: attribute in the first node.

    In your example this appears in the first <dfs:dataFields node -  this node uses the short namespace letters 'dfs' and then defines dfs as representing 'http://schemas. blah blah blah" so then later nodes which use the dfs: namespace leading characters will also be interpreted as part of the http://blahblah namespace.

    Honestly, I've never seen the xmlns http://blahblah namespace mean anything other than a way to distinguish groups of nodes - for e.g. in my own xml I use ds1: and I have xmlns:ds1="http://skarnRocks" and it doesn't really matter much that that address is completely made up.

     Hope my self-educated interpretation of what those things mean helps you. God forbid it confuses you! :-/ good luck.

     

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