List Info

Thread: AttributeNodeCount and ChildCount




AttributeNodeCount and ChildCount
user name
2006-11-21 07:36:15
G'day

I getting strange results from Sabletron which I don't yet
understand.
I'm happy to work around them if the results are correct.

I have a xml with 4 attributes in the root node and three
children

	status = SDOM_getChildNodeCount(situation, node,
&childCount) ;

	status = SDOM_getAttributeNodeCount(situation, node,
&attributeCount) ;
					

-- 
Keith Hutchison
http://balance-infosys
tems.com http://realopen.org
http://www.kas
amba.com/Keith-Hutchison
------------------------------------------------------------
------------

Archives and info: http
://www.gingerall.org/charlie/ga/xml/m_ml.xml

Mailing list maintained by Ginger Alliance

AttributeNodeCount and ChildCount
user name
2006-11-21 07:45:00
G'day

I getting strange results from Sabletron which I don't yet
understand.
I'm happy to work around them if the results are correct.

I have a xml with 4 attributes in the root node and three
children

       status = SDOM_getChildNodeCount(situation, node,
&childCount) ;
// returns 7 i'm expecting 3

       status = SDOM_getAttributeNodeCount(situation, node,
&attributeCount)
// returns 6, I'm expecting 4

Any ideas on how to 3 for childCount and 4 for attribute
count?


Thanks in advance

-- 
Keith Hutchison
http://balance-infosys
tems.com http://realopen.org
http://www.kas
amba.com/Keith-Hutchison
------------------------------------------------------------
------------

Archives and info: http
://www.gingerall.org/charlie/ga/xml/m_ml.xml

Mailing list maintained by Ginger Alliance

AttributeNodeCount and ChildCount
user name
2006-11-22 07:43:22
Hi Keith,

Keith Hutchison wrote:
> G'day
> 
> I getting strange results from Sabletron which I don't
yet understand.
> I'm happy to work around them if the results are
correct.
> 
> I have a xml with 4 attributes in the root node and
three children
> 
>       status = SDOM_getChildNodeCount(situation, node,
&childCount) ;
> // returns 7 i'm expecting 3
> 
>       status = SDOM_getAttributeNodeCount(situation,
node, &attributeCount)
> // returns 6, I'm expecting 4
> 
> Any ideas on how to 3 for childCount and 4 for
attribute count?


The extra nodes are likely whitespace text nodes. Check type
of nodes and filter 
them if necessary. I'm not sure what could be the extra
attributes, maybe NS 
declarations. Can you list their names to see what is going
on?

We would need to see a relevant part of your code and the
input XML to be able 
to tell you more.

Petr

-- 
Petr Cimprich
Ginger Alliance
www.gingerall.com
------------------------------------------------------------
------------

Archives and info: http
://www.gingerall.org/charlie/ga/xml/m_ml.xml

Mailing list maintained by Ginger Alliance

AttributeNodeCount and ChildCount
user name
2006-11-22 08:02:26
Hi Petr


> > Any ideas on how to 3 for childCount and 4 for
attribute count?
>
>
> The extra nodes are likely whitespace text nodes. Check
type of nodes and filter
> them if necessary. I'm not sure what could be the extra
attributes, maybe NS
> declarations. Can you list their names to see what is
going on?
>
> We would need to see a relevant part of your code and
the input XML to be able
> to tell you more.
>

<?xml version="1.0"
encoding="UTF-8"?>
<folderActions name="Keith Hutchison"
		email="keith.hutchisonbalance-infosystems.com"
		referredBy="keith.hutchisonbalance-infosystems.com"
		key="F825514D-9C3E8911-901F551C-EAE3BDB2">
	<folderAction
		name="importPhoneBill"
		process="c:contactsTodd
LowderTelephoneBills.mdb"
		application="MSAccess"
		topic="TelephoneBills;SQL select
processFile(':path')"
		command=""
		watch="c:contactsTodd Lowderdata"
		/>
	<folderAction
		name="importPhoneBill"
		process="c:contactsTodd
LowderTelephoneBills.mdb"
		application="MSAccess"
		topic="TelephoneBills;SQL select
processFile(':path')"
		command="helloWorld"
		watch="c:contactsTodd Lowderdata"
		/>
	<folderAction
		name="importSurveyData"
		process="c:analyserPlus.exe"
		application="AnalyserPlus"
		topic="AnalyserPlus"
		watch="c:analysersurveys"
		/>
</folderActions>

I'm now disregarding the attribute counts and now stepping
through
each child and testing for the type.

I'd like to know how to get a count of just elements and
I've got it
working as it is.

Thanks

-- 
Keith Hutchison
http://balance-infosys
tems.com http://realopen.org
http://www.kas
amba.com/Keith-Hutchison
------------------------------------------------------------
------------

Archives and info: http
://www.gingerall.org/charlie/ga/xml/m_ml.xml

Mailing list maintained by Ginger Alliance

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )