Design of lookup instance

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Design of lookup instance

Richard Braman
Message
Heres my problem/use case
 
I have two static "lookup" instances
1 containing a <taxtable>
the other an <earned-income-credit-table.>
 
I will be using the table(s) the same way to look up the <tax> or the <credit> using the respective table.  Each instance has an id to keep em seperated
 
assume I have 4 seprate nodes called
<filing-status>
<income>and
<tax>
<credit> in my <instance>
 
The logic for looking up the <tax> or the <credit> is the same, so I will use <tax> as an example.  I need help determining the best way to structure the data in
<taxtable>
 
based on the value of <income> and <filing-status> I need to lookup the value in the <taxtable> to set the value of <tax>
The <taxtable> data has the following features for each <item> and there are 2164 <item>s
an <income-equal-or-greater-than> element which is the lower limit of income for the stated tax
an <income-less-than> element which is the upper limit of income for the stated tax
a <tax-single> element which holds the amount of <tax> if the filer is single
and a <tax-married-filing-jointly> element which holds the amount of <tax> if the filer is married
 
The logic goes like this:
If <income> falls between <income-equal-or-greater-than> and <income-less-than>
then <tax> is equal to either <tax-single> if <filing-status> =1 or <tax-married-filing-jointly> =2
 
i have
<xforms:bind id="tax" nodeset="('main-instance')/form/tax" calculate="This is my question, What would be the xpath expression, and what would be the best way to structure <taxtable> to make the lookup most efficient and to minimize instance size">
 
Here is a crack at the xPath.  I don't know if it is right.  This assumes <taxable> looks like this
<taxtable>
<item>
<income-equal-or-greater-than>0</income-equal-or-greater-than> 
<income-less-than>5</income-less-than>
<tax-single>0</tax-single>
<tax-married-filing-jointly>0</tax-married-filing-jointly>
</item>
....more items
</tax-table>
 
if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than
&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than
&& instance('main-instance')/form/filing-status = 1
instance('taxtable')/item/tax-single
 
 
if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than
&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than
&& instance('main-instance')/form/filing-status = 2
instance('taxtable')/item/tax-married-filing-jointly
 
Is is possible to have to xPath ifs in the same xforms calculate
 
I am designing, so I can call the nodes in <tax-table> whatever I want and I can structure it whatever way is best, maybe the nodes should be attributes.
 
Your comments are appreciated.
 
 
 
 
 
 

Richard Braman
[hidden email]
561.748.4002 (voice)

http://www.taxcodesoftware.org
Free Open Source Tax Software

 


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Design of lookup instance

Richard Braman
Message
I created the attached file to play with my prototype for this part of my app, but I am getting a strange error on my local copy of OPS
XForms error: Node is not an element or attribute
 
I ran the file in orbeons sandbox, and it doesn't show up.  I know it has something to do with the CSS, because I had to remove all of the user defined css code in the themes.xsl file to get it to show up on my OPS.
 
I have tried just about everything I know of to get arid of the error, but it is being pesky.  I also notice that the initial value for <income> in my instance isn't showing up,
that has to have something to do with it.
 
 
-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 3:51 PM
To: [hidden email]
Subject: [ops-users] Design of lookup instance

Heres my problem/use case
 
I have two static "lookup" instances
1 containing a <taxtable>
the other an <earned-income-credit-table.>
 
I will be using the table(s) the same way to look up the <tax> or the <credit> using the respective table.  Each instance has an id to keep em seperated
 
assume I have 4 seprate nodes called
<filing-status>
<income>and
<tax>
<credit> in my <instance>
 
The logic for looking up the <tax> or the <credit> is the same, so I will use <tax> as an example.  I need help determining the best way to structure the data in
<taxtable>
 
based on the value of <income> and <filing-status> I need to lookup the value in the <taxtable> to set the value of <tax>
The <taxtable> data has the following features for each <item> and there are 2164 <item>s
an <income-equal-or-greater-than> element which is the lower limit of income for the stated tax
an <income-less-than> element which is the upper limit of income for the stated tax
a <tax-single> element which holds the amount of <tax> if the filer is single
and a <tax-married-filing-jointly> element which holds the amount of <tax> if the filer is married
 
The logic goes like this:
If <income> falls between <income-equal-or-greater-than> and <income-less-than>
then <tax> is equal to either <tax-single> if <filing-status> =1 or <tax-married-filing-jointly> =2
 
i have
<xforms:bind id="tax" nodeset="('main-instance')/form/tax" calculate="This is my question, What would be the xpath expression, and what would be the best way to structure <taxtable> to make the lookup most efficient and to minimize instance size">
 
Here is a crack at the xPath.  I don't know if it is right.  This assumes <taxable> looks like this
<taxtable>
<item>
<income-equal-or-greater-than>0</income-equal-or-greater-than> 
<income-less-than>5</income-less-than>
<tax-single>0</tax-single>
<tax-married-filing-jointly>0</tax-married-filing-jointly>
</item>
....more items
</tax-table>
 
if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than
&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than
&& instance('main-instance')/form/filing-status = 1
instance('taxtable')/item/tax-single
 
 
if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than
&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than
&& instance('main-instance')/form/filing-status = 2
instance('taxtable')/item/tax-married-filing-jointly
 
Is is possible to have to xPath ifs in the same xforms calculate
 
I am designing, so I can call the nodes in <tax-table> whatever I want and I can structure it whatever way is best, maybe the nodes should be attributes.
 
Your comments are appreciated.
 
 
 
 
 
 

Richard Braman
[hidden email]
561.748.4002 (voice)

http://www.taxcodesoftware.org
Free Open Source Tax Software

 


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

test-taxtable-logic.xhtml (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Design of lookup instance

Richard Braman
Message
Well, I at least got arid of the XForms error: Node is not an element or attribute error.  My XPath still needs work though.
It seems like you cannot define your instance right inside in the model, you have to use the src="oxf://path-to-instance"
or it busts.  Why is this?
-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 6:03 PM
To: [hidden email]
Subject: RE: [ops-users] Design of lookup instance

I created the attached file to play with my prototype for this part of my app, but I am getting a strange error on my local copy of OPS
XForms error: Node is not an element or attribute
 
I ran the file in orbeons sandbox, and it doesn't show up.  I know it has something to do with the CSS, because I had to remove all of the user defined css code in the themes.xsl file to get it to show up on my OPS.
 
I have tried just about everything I know of to get arid of the error, but it is being pesky.  I also notice that the initial value for <income> in my instance isn't showing up,
that has to have something to do with it.
 
 
-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 3:51 PM
To: [hidden email]
Subject: [ops-users] Design of lookup instance

Heres my problem/use case
 
I have two static "lookup" instances
1 containing a <taxtable>
the other an <earned-income-credit-table.>
 
I will be using the table(s) the same way to look up the <tax> or the <credit> using the respective table.  Each instance has an id to keep em seperated
 
assume I have 4 seprate nodes called
<filing-status>
<income>and
<tax>
<credit> in my <instance>
 
The logic for looking up the <tax> or the <credit> is the same, so I will use <tax> as an example.  I need help determining the best way to structure the data in
<taxtable>
 
based on the value of <income> and <filing-status> I need to lookup the value in the <taxtable> to set the value of <tax>
The <taxtable> data has the following features for each <item> and there are 2164 <item>s
an <income-equal-or-greater-than> element which is the lower limit of income for the stated tax
an <income-less-than> element which is the upper limit of income for the stated tax
a <tax-single> element which holds the amount of <tax> if the filer is single
and a <tax-married-filing-jointly> element which holds the amount of <tax> if the filer is married
 
The logic goes like this:
If <income> falls between <income-equal-or-greater-than> and <income-less-than>
then <tax> is equal to either <tax-single> if <filing-status> =1 or <tax-married-filing-jointly> =2
 
i have
<xforms:bind id="tax" nodeset="('main-instance')/form/tax" calculate="This is my question, What would be the xpath expression, and what would be the best way to structure <taxtable> to make the lookup most efficient and to minimize instance size">
 
Here is a crack at the xPath.  I don't know if it is right.  This assumes <taxable> looks like this
<taxtable>
<item>
<income-equal-or-greater-than>0</income-equal-or-greater-than> 
<income-less-than>5</income-less-than>
<tax-single>0</tax-single>
<tax-married-filing-jointly>0</tax-married-filing-jointly>
</item>
....more items
</tax-table>
 
if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than
&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than
&& instance('main-instance')/form/filing-status = 1
instance('taxtable')/item/tax-single
 
 
if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than
&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than
&& instance('main-instance')/form/filing-status = 2
instance('taxtable')/item/tax-married-filing-jointly
 
Is is possible to have to xPath ifs in the same xforms calculate
 
I am designing, so I can call the nodes in <tax-table> whatever I want and I can structure it whatever way is best, maybe the nodes should be attributes.
 
Your comments are appreciated.
 
 
 
 
 
 

Richard Braman
[hidden email]
561.748.4002 (voice)

http://www.taxcodesoftware.org
Free Open Source Tax Software

 


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Design of lookup instance: getting closer on XPath

Richard Braman
Message
I also got some Xpath to run with no compiler error, it doesn't work though :<
 
 
PS. Why do you only need to escape < with &lt; and not > with &gt; in the Xpath expression?
calculate="
       if (instance('main-instance')/form/f1040ez/income >= instance('taxtable')/item/income-equal-or-greater-than
       and instance('main-instance')/form/f1040ez/income &lt; instance('taxtable')/item/income-less-than
       and instance('main-instance')/form/f1040ez/filing-status = '1') then
       instance('taxtable')/item/tax-single
       else
       if (instance('main-instance')/form/f1040ez/income >= instance('taxtable')/item/income-equal-or-greater-than
       and instance('main-instance')/form/f1040ez/income &lt; instance('taxtable')/item/income-less-than
       and instance('main-instance')/form/f1040ez/filing-status = '2') then
       instance('taxtable')/item/tax-married-filing-jointly
         else '0'  
   "/>
 
 
 
-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 8:45 PM
To: [hidden email]
Subject: RE: [ops-users] Design of lookup instance

Well, I at least got arid of the XForms error: Node is not an element or attribute error.  My XPath still needs work though.
It seems like you cannot define your instance right inside in the model, you have to use the src="oxf://path-to-instance"
or it busts.  Why is this?
-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 6:03 PM
To: [hidden email]
Subject: RE: [ops-users] Design of lookup instance

I created the attached file to play with my prototype for this part of my app, but I am getting a strange error on my local copy of OPS
XForms error: Node is not an element or attribute
 
I ran the file in orbeons sandbox, and it doesn't show up.  I know it has something to do with the CSS, because I had to remove all of the user defined css code in the themes.xsl file to get it to show up on my OPS.
 
I have tried just about everything I know of to get arid of the error, but it is being pesky.  I also notice that the initial value for <income> in my instance isn't showing up,
that has to have something to do with it.
 
 
-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 3:51 PM
To: [hidden email]
Subject: [ops-users] Design of lookup instance

Heres my problem/use case
 
I have two static "lookup" instances
1 containing a <taxtable>
the other an <earned-income-credit-table.>
 
I will be using the table(s) the same way to look up the <tax> or the <credit> using the respective table.  Each instance has an id to keep em seperated
 
assume I have 4 seprate nodes called
<filing-status>
<income>and
<tax>
<credit> in my <instance>
 
The logic for looking up the <tax> or the <credit> is the same, so I will use <tax> as an example.  I need help determining the best way to structure the data in
<taxtable>
 
based on the value of <income> and <filing-status> I need to lookup the value in the <taxtable> to set the value of <tax>
The <taxtable> data has the following features for each <item> and there are 2164 <item>s
an <income-equal-or-greater-than> element which is the lower limit of income for the stated tax
an <income-less-than> element which is the upper limit of income for the stated tax
a <tax-single> element which holds the amount of <tax> if the filer is single
and a <tax-married-filing-jointly> element which holds the amount of <tax> if the filer is married
 
The logic goes like this:
If <income> falls between <income-equal-or-greater-than> and <income-less-than>
then <tax> is equal to either <tax-single> if <filing-status> =1 or <tax-married-filing-jointly> =2
 
i have
<xforms:bind id="tax" nodeset="('main-instance')/form/tax" calculate="This is my question, What would be the xpath expression, and what would be the best way to structure <taxtable> to make the lookup most efficient and to minimize instance size">
 
Here is a crack at the xPath.  I don't know if it is right.  This assumes <taxable> looks like this
<taxtable>
<item>
<income-equal-or-greater-than>0</income-equal-or-greater-than> 
<income-less-than>5</income-less-than>
<tax-single>0</tax-single>
<tax-married-filing-jointly>0</tax-married-filing-jointly>
</item>
....more items
</tax-table>
 
if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than
&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than
&& instance('main-instance')/form/filing-status = 1
instance('taxtable')/item/tax-single
 
 
if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than
&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than
&& instance('main-instance')/form/filing-status = 2
instance('taxtable')/item/tax-married-filing-jointly
 
Is is possible to have to xPath ifs in the same xforms calculate
 
I am designing, so I can call the nodes in <tax-table> whatever I want and I can structure it whatever way is best, maybe the nodes should be attributes.
 
Your comments are appreciated.
 
 
 
 
 
 

Richard Braman
[hidden email]
561.748.4002 (voice)

http://www.taxcodesoftware.org
Free Open Source Tax Software

 


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Design of lookup instance: getting closer on XPath

Ryan Puddephatt
Message

Richard,

            With XPath try using the following

 

< is just lt

> is just gt

<= is just le

>= is just ge

 

This should work

 

Ryan Puddephatt

Software Engineer

TFX Group - IT UK

1 Michaelson Square

Livingston

West Lothian

Scotand

EH54 7DP

 

* [hidden email]

( 01506 407 110

7  01506 407 108

 


From: Richard Braman [mailto:[hidden email]]
Sent: 22 February 2006 02:04
To: [hidden email]
Subject: RE: [ops-users] Design of lookup instance: getting closer on XPath

 

I also got some Xpath to run with no compiler error, it doesn't work though :<

 

 

PS. Why do you only need to escape < with &lt; and not > with &gt; in the Xpath expression?

calculate="
       if (instance('main-instance')/form/f1040ez/income >= instance('taxtable')/item/income-equal-or-greater-than
       and instance('main-instance')/form/f1040ez/income &lt; instance('taxtable')/item/income-less-than
       and instance('main-instance')/form/f1040ez/filing-status = '1') then
       instance('taxtable')/item/tax-single
       else
       if (instance('main-instance')/form/f1040ez/income >= instance('taxtable')/item/income-equal-or-greater-than
       and instance('main-instance')/form/f1040ez/income &lt; instance('taxtable')/item/income-less-than
       and instance('main-instance')/form/f1040ez/filing-status = '2') then
       instance('taxtable')/item/tax-married-filing-jointly
         else '0'  
   "/>

 

 

 

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 8:45 PM
To: [hidden email]
Subject: RE: [ops-users] Design of lookup instance

Well, I at least got arid of the XForms error: Node is not an element or attribute error.  My XPath still needs work though.

It seems like you cannot define your instance right inside in the model, you have to use the src="oxf://path-to-instance"

or it busts.  Why is this?

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 6:03 PM
To: [hidden email]
Subject: RE: [ops-users] Design of lookup instance

I created the attached file to play with my prototype for this part of my app, but I am getting a strange error on my local copy of OPS

XForms error: Node is not an element or attribute

 

I ran the file in orbeons sandbox, and it doesn't show up.  I know it has something to do with the CSS, because I had to remove all of the user defined css code in the themes.xsl file to get it to show up on my OPS.

 

I have tried just about everything I know of to get arid of the error, but it is being pesky.  I also notice that the initial value for <income> in my instance isn't showing up,

that has to have something to do with it.

 

 

-----Original Message-----
From: Richard Braman [mailto:[hidden email]]
Sent: Tuesday, February 21, 2006 3:51 PM
To: [hidden email]
Subject: [ops-users] Design of lookup instance

Heres my problem/use case

 

I have two static "lookup" instances

1 containing a <taxtable>

the other an <earned-income-credit-table.>

 

I will be using the table(s) the same way to look up the <tax> or the <credit> using the respective table.  Each instance has an id to keep em seperated

 

assume I have 4 seprate nodes called

<filing-status>

<income>and

<tax>

<credit> in my <instance>

 

The logic for looking up the <tax> or the <credit> is the same, so I will use <tax> as an example.  I need help determining the best way to structure the data in

<taxtable>

 

based on the value of <income> and <filing-status> I need to lookup the value in the <taxtable> to set the value of <tax>

The <taxtable> data has the following features for each <item> and there are 2164 <item>s

an <income-equal-or-greater-than> element which is the lower limit of income for the stated tax

an <income-less-than> element which is the upper limit of income for the stated tax

a <tax-single> element which holds the amount of <tax> if the filer is single

and a <tax-married-filing-jointly> element which holds the amount of <tax> if the filer is married

 

The logic goes like this:

If <income> falls between <income-equal-or-greater-than> and <income-less-than>

then <tax> is equal to either <tax-single> if <filing-status> =1 or <tax-married-filing-jointly> =2

 

i have

<xforms:bind id="tax" nodeset="('main-instance')/form/tax" calculate="This is my question, What would be the xpath expression, and what would be the best way to structure <taxtable> to make the lookup most efficient and to minimize instance size">

 

Here is a crack at the xPath.  I don't know if it is right.  This assumes <taxable> looks like this

<taxtable>

<item>

<income-equal-or-greater-than>0</income-equal-or-greater-than> 

<income-less-than>5</income-less-than>

<tax-single>0</tax-single>

<tax-married-filing-jointly>0</tax-married-filing-jointly>

</item>

....more items

</tax-table>

 

if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than

&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than

&& instance('main-instance')/form/filing-status = 1

instance('taxtable')/item/tax-single

 

 

if instance('main-instance')/form/income >= instance('taxtable')/item/income-equal-or-greater-than

&&  instance('main-instance')/form/income < instance('taxtable')/item/income-less-than

&& instance('main-instance')/form/filing-status = 2

instance('taxtable')/item/tax-married-filing-jointly

 

Is is possible to have to xPath ifs in the same xforms calculate

 

I am designing, so I can call the nodes in <tax-table> whatever I want and I can structure it whatever way is best, maybe the nodes should be attributes.

 

Your comments are appreciated.

 

 

 

 

 

 

Richard Braman
[hidden email]
561.748.4002 (voice)

http://www.taxcodesoftware.org
Free Open Source Tax Software

 



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Design of lookup instance

Alessandro  Vernet
Administrator
In reply to this post by Richard Braman
Richard,

Your file didn't run in the XForms sandbox because it was declaring
XHTML as a default namespace, so the elements in your instance are in
this namespace, which is not what you want, I guess :).

This problem is very easy to hit when using default namespaces. My
recommendation, for this reason and others mentioned earlier in this
list, is to never use default namespaces and always use explicit
prefixes.

This also explains why your code works when you use an external instance.

I have attached to this email a copy of your file with explicit prefixes.

Alex

On 2/21/06, Richard Braman <[hidden email]> wrote:

>
> I created the attached file to play with my prototype for this part of my
> app, but I am getting a strange error on my local copy of OPS
> XForms error: Node is not an element or attribute
> see http://24.75.221.234:8080/taxcode/1040ez/test for
> example
>
> I ran the file in orbeons sandbox, and it doesn't show up.  I know it has
> something to do with the CSS, because I had to remove all of the user
> defined css code in the themes.xsl file to get it to show up on my OPS.
>
> I have tried just about everything I know of to get arid of the error, but
> it is being pesky.  I also notice that the initial value for <income> in my
> instance isn't showing up,
> that has to have something to do with it.
>
>
>
>
>
> -----Original Message-----
> From: Richard Braman [mailto:[hidden email]]
> Sent: Tuesday, February 21, 2006 3:51 PM
> To: [hidden email]
> Subject: [ops-users] Design of lookup instance
>
>
> Heres my problem/use case
>
> I have two static "lookup" instances
> 1 containing a <taxtable>
> the other an <earned-income-credit-table.>
>
> I will be using the table(s) the same way to look up the <tax> or the
> <credit> using the respective table.  Each instance has an id to keep em
> seperated
>
> assume I have 4 seprate nodes called
> <filing-status>
> <income>and
> <tax>
> <credit> in my <instance>
>
> The logic for looking up the <tax> or the <credit> is the same, so I will
> use <tax> as an example.  I need help determining the best way to structure
> the data in
> <taxtable>
>
> based on the value of <income> and <filing-status> I need to lookup the
> value in the <taxtable> to set the value of <tax>
> The <taxtable> data has the following features for each <item> and there are
> 2164 <item>s
> an <income-equal-or-greater-than> element which is the lower limit of income
> for the stated tax
>
> an <income-less-than> element which is the upper limit of income for the
> stated tax
> a <tax-single> element which holds the amount of <tax> if the filer is
> single
> and a <tax-married-filing-jointly> element which holds the amount of <tax>
> if the filer is married
>
> The logic goes like this:
> If <income> falls between <income-equal-or-greater-than> and
> <income-less-than>
> then <tax> is equal to either <tax-single> if <filing-status> =1 or
> <tax-married-filing-jointly> =2
>
> i have
> <xforms:bind id="tax" nodeset="('main-instance')/form/tax"
> calculate="This is my question, What would be the xpath expression, and what
> would be the best way to structure <taxtable> to make the lookup most
> efficient and to minimize instance size">
>
> Here is a crack at the xPath.  I don't know if it is right.  This assumes
> <taxable> looks like this
> <taxtable>
> <item>
>
> <income-equal-or-greater-than>0</income-equal-or-greater-than>
> <income-less-than>5</income-less-than>
>
> <tax-single>0</tax-single>
> <tax-married-filing-jointly>0</tax-married-filing-jointly>
> </item>
> ....more items
> </tax-table>
>
> if instance('main-instance')/form/income >=
> instance('taxtable')/item/income-equal-or-greater-than
> &&  instance('main-instance')/form/income <
> instance('taxtable')/item/income-less-than
> && instance('main-instance')/form/filing-status = 1
> instance('taxtable')/item/tax-single
>
>
>
> if instance('main-instance')/form/income >=
> instance('taxtable')/item/income-equal-or-greater-than
> &&  instance('main-instance')/form/income <
> instance('taxtable')/item/income-less-than
> && instance('main-instance')/form/filing-status = 2
> instance('taxtable')/item/tax-married-filing-jointly
>
> Is is possible to have to xPath ifs in the same xforms calculate
>
> I am designing, so I can call the nodes in <tax-table> whatever I want and I
> can structure it whatever way is best, maybe the nodes should be attributes.
>
> Your comments are appreciated.
>
>
>
>
>
>
>
> Richard Braman
> mailto:[hidden email]
> 561.748.4002 (voice)
>
> http://www.taxcodesoftware.org
> Free Open Source Tax Software
>
>
> --
> You receive this message as a subscriber of the [hidden email]
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

test-taxtable-logic-with-prefix.xhtml (3K) Download Attachment
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet