<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Getting the node type, ie: Group or Field.</title><link>https://www.infopathdev.com:443/forums/thread/14343.aspx</link><pubDate>Fri, 03 Mar 2006 20:48:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14343</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14343.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14343</wfw:commentRss><description>Hi, &lt;br /&gt;You can get the child nodes using the "child::node()" Xpath.&lt;br /&gt;node.selectNodes("child::node()").length should give you the length of the child nodes.&lt;br /&gt;</description></item><item><title>Re: Getting the node type, ie: Group or Field.</title><link>https://www.infopathdev.com:443/forums/thread/14342.aspx</link><pubDate>Fri, 03 Mar 2006 19:09:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14342</guid><dc:creator>K.Ramana Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14342.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14342</wfw:commentRss><description>Hi Reg,&lt;br /&gt;&lt;br /&gt;You are correct reg, i saw same thing what you mentioned,&lt;br /&gt;i tried so many things to get correct result, but i did not get it,&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;</description></item><item><title>Re: Getting the node type, ie: Group or Field.</title><link>https://www.infopathdev.com:443/forums/thread/14341.aspx</link><pubDate>Fri, 03 Mar 2006 13:57:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14341</guid><dc:creator>rjohnson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14341.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14341</wfw:commentRss><description>Hi K.Ramana,&lt;br /&gt;&lt;br /&gt;Thanks for your reply,&lt;br /&gt;&lt;br /&gt;However, I don't think that 'childNodes.length' can always guarantee that returning a 0, is always from a field.&lt;br /&gt;&lt;br /&gt;For example, I noticed that if the field is empty, it will return 0, but if the field contains a value, it will return 1.&lt;br /&gt;&lt;br /&gt;Contrary, if a "group" has no fields in it, it too will return 0.&lt;br /&gt;&lt;br /&gt;If you are able to, can you clarify if these notions are correct.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;- Reg.</description></item><item><title>Re: Getting the node type, ie: Group or Field.</title><link>https://www.infopathdev.com:443/forums/thread/14340.aspx</link><pubDate>Fri, 03 Mar 2006 05:49:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14340</guid><dc:creator>K.Ramana Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14340.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14340</wfw:commentRss><description>Hi,&lt;br /&gt;For given node,check childNodes.length&amp;gt;0,&lt;br /&gt;If it is, it will be group otherwise field. &lt;br /&gt;&lt;br /&gt;Thanks.</description></item><item><title>Getting the node type, ie: Group or Field.</title><link>https://www.infopathdev.com:443/forums/thread/12791.aspx</link><pubDate>Sun, 26 Feb 2006 09:23:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12791</guid><dc:creator>rjohnson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12791.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12791</wfw:commentRss><description>Hi all,&lt;br /&gt;&lt;br /&gt;I was wondering if there was a way of determining whether a given node is a 'Group', or a 'Field', via JScript code.&lt;br /&gt;&lt;br /&gt;I've tried several ways to get that information, but none have succeeded.&lt;br /&gt;Since I can actually see whether it is a Group or Field in the InfoPath GUI, I would figure there is a way of getting that information with code.&lt;br /&gt;&lt;br /&gt;I tried:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;var Node = XDocument.DOM.selectSingleNode("/my:myFields");&lt;/b&gt;&lt;br /&gt;which sets Node to the group in the dataSource, and then I try to get its Type with:&lt;br /&gt;&lt;b&gt;XDocument.UI.Alert( Node.nodeType )&lt;/b&gt;&lt;br /&gt;but this returns the value 1.&lt;br /&gt;&lt;br /&gt;Likewise, if I access a field in the dataSource&lt;br /&gt;&lt;b&gt;var Node = XDocument.DOM.selectSingleNode("/my:myFields/my:myField1");&lt;/b&gt;&lt;br /&gt;and get its nodeType, it returns 1 as well.&lt;br /&gt;&lt;br /&gt;I believe the 1 that is being returned, actually represents that it is an element,&lt;br /&gt;but is there a way of knowing whether a node is set to a field or group?&lt;br /&gt;&lt;br /&gt;Any help would be welcomed,&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;- Reg.</description></item></channel></rss>