It looks like the oxf:sql is not handling nested groups correctly
(possibly I do not understand the intended behavior). There are 2 issues I noticed: 1) the nesting is wrong. For each order "purchaseorder-group" there should be one or more "order" groups containing one or more "details" 2) not sure why is the processor geenrating the empty namespace declaration whenever an attribute is generated. For example - <details xmlns:T_ID="" T_ID="130623"> Alex The processor config snippet: <sql:result-set> <orders> <sql:row-iterator> <sql:group column-name="purchaseordernumber"> <purchaseorder-group> <sql:attribute name="purchaseordernumber"> <sql:get-column-value type="xs:string" column-name="purchaseordernumber"/> </sql:attribute> <sql:member> <order> <company> <sql:get-column-value type="xs:string" column-name="company"/> </company> <podate> <sql:get-column-value type="xs:decimal" column-name="podate"/> </podate> <rshdate> <sql:get-column-value type="xs:decimal" column-name="rshdate"/> </rshdate> <status> <sql:get-column-value type="xs:decimal" column-name="status"/> </status> <complete> <sql:get-column-value type="xs:decimal" column-name="complete"/> </complete> <sql:group column-name="T_ID"> <details> <sql:attribute name="T_ID"> <sql:get-column-value type="xs:decimal" column-name="T_ID"/> </sql:attribute> <sql:member> <detail> < ordered> <sql:get-column-value type="xs:decimal" column-name="ordered"/> </ordered> <invoiced > <sql:get-column-value type="xs:decimal" column-name="invoiced"/> </invoiced > <shipped > <sql:get-column-value type="xs:decimal" column-name="shipped"/> </shipped > </detail> </sql:member> </details> </sql:group> </order> </sql:member> </purchaseorder-group> </sql:group> </sql:row-iterator> </orders> </sql:result-set> resulting XML snippet: <orders> <purchaseorder-group xmlns:purchaseordernumber="" purchaseordernumber="0369593"> <order> <company>Test Inc.</company> <podate>20050504</podate> <rshdate>20050513</rshdate> <details xmlns:T_ID="" T_ID="130621"> <detail> <ordered>8</ordered> <invoiced>4</invoiced> <shipped>4</shipped> </detail> <status>810</status> <complete>Y</complete> </details> <order> <company>Test Inc.</company> <podate>20050504</podate> <rshdate>20050513</rshdate> <detail> <ordered>8</ordered> <invoiced>4</invoiced> <shipped>4</shipped> </detail> <order> <company>Test Inc.</company> <podate>20050504</podate> <rshdate>20050513</rshdate> <detail> <ordered>8</ordered> <invoiced>4</invoiced> <shipped>4</shipped> </detail> <order> <company>Test Inc.</company> <podate>20050504</podate> <rshdate>20050513</rshdate> <detail> <ordered>8</ordered> <invoiced>4</invoiced> <shipped>4</shipped> </detail> </order> <order> <company>Test Inc.</company> <podate>20050504</podate> <rshdate>20050513</rshdate> <details xmlns:T_ID="" T_ID="130623"> <detail> <ordered>8</ordered> <invoiced>8</invoiced> <shipped>8</shipped> </detail> <status>810</status> <complete>Y</complete> </details> </order> </order> </order> </order> </purchaseorder-group> </orders> -- 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 |
Administrator
|
An example that simple should work. First, did you make sure you order
the result of your SQL query first by purchaseordernumber, then by T_ID, i.e.: select ... order by purchaseordernumber, T_ID My guess is that the SQL processor could be smarter about namespace generation, but I don't think this particular namespace declaration should be there unless you declared it somewhere else. Is that particular declaration problematic for you? -Erik Alexander Zatko wrote: > It looks like the oxf:sql is not handling nested groups correctly > (possibly I do not understand the intended behavior). There are 2 issues > I noticed: > > 1) the nesting is wrong. For each order "purchaseorder-group" there > should be one or more "order" groups containing one or more "details" > 2) not sure why is the processor geenrating the empty namespace > declaration whenever an attribute is generated. > For example - <details xmlns:T_ID="" T_ID="130623"> > > Alex > > The processor config snippet: > > <sql:result-set> > <orders> > <sql:row-iterator> > <sql:group column-name="purchaseordernumber"> > <purchaseorder-group> > <sql:attribute name="purchaseordernumber"> > <sql:get-column-value type="xs:string" > column-name="purchaseordernumber"/> > </sql:attribute> > <sql:member> > <order> > <company> > <sql:get-column-value type="xs:string" > column-name="company"/> > </company> > <podate> > <sql:get-column-value type="xs:decimal" > column-name="podate"/> > </podate> > <rshdate> > <sql:get-column-value type="xs:decimal" > column-name="rshdate"/> > </rshdate> > <status> > <sql:get-column-value type="xs:decimal" > column-name="status"/> > </status> > <complete> > <sql:get-column-value type="xs:decimal" > column-name="complete"/> > </complete> > <sql:group column-name="T_ID"> > <details> > <sql:attribute name="T_ID"> > <sql:get-column-value > type="xs:decimal" column-name="T_ID"/> > </sql:attribute> > <sql:member> > <detail> > < ordered> > <sql:get-column-value > type="xs:decimal" column-name="ordered"/> > </ordered> > <invoiced > > <sql:get-column-value > type="xs:decimal" column-name="invoiced"/> > </invoiced > > <shipped > > <sql:get-column-value > type="xs:decimal" column-name="shipped"/> > </shipped > > </detail> > </sql:member> > </details> > </sql:group> > </order> > </sql:member> > </purchaseorder-group> > </sql:group> > </sql:row-iterator> > </orders> > </sql:result-set> > > resulting XML snippet: > > <orders> > <purchaseorder-group xmlns:purchaseordernumber="" > purchaseordernumber="0369593"> > <order> > <company>Test Inc.</company> > <podate>20050504</podate> > <rshdate>20050513</rshdate> > <details xmlns:T_ID="" T_ID="130621"> > <detail> > <ordered>8</ordered> > <invoiced>4</invoiced> > <shipped>4</shipped> > </detail> > <status>810</status> > <complete>Y</complete> > </details> > <order> > <company>Test Inc.</company> > <podate>20050504</podate> > <rshdate>20050513</rshdate> > <detail> > <ordered>8</ordered> > <invoiced>4</invoiced> > <shipped>4</shipped> > </detail> > <order> > <company>Test Inc.</company> > <podate>20050504</podate> > <rshdate>20050513</rshdate> > <detail> > <ordered>8</ordered> > <invoiced>4</invoiced> > <shipped>4</shipped> > </detail> > <order> > <company>Test Inc.</company> > <podate>20050504</podate> > <rshdate>20050513</rshdate> > <detail> > <ordered>8</ordered> > <invoiced>4</invoiced> > <shipped>4</shipped> > </detail> > </order> > <order> > <company>Test Inc.</company> > <podate>20050504</podate> > <rshdate>20050513</rshdate> > <details xmlns:T_ID="" T_ID="130623"> > <detail> > <ordered>8</ordered> > <invoiced>8</invoiced> > <shipped>8</shipped> > </detail> > <status>810</status> > <complete>Y</complete> > </details> > </order> > </order> > </order> > </order> > </purchaseorder-group> > </orders> -- 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 |
Erik,
Yes, I did have the columns sorted the way you show below. I ended up going with the nested queries alternative shown in the documentation and that seems to work just fine. As for the namespace - I do not think it is going to cause any problems. I will let you know if it does. Thanks A. On Nov 14, 2005, at 4:10 PM, Erik Bruchez wrote: > An example that simple should work. First, did you make sure you order > the result of your SQL query first by purchaseordernumber, then by > T_ID, i.e.: > > select ... > order by purchaseordernumber, T_ID > > My guess is that the SQL processor could be smarter about namespace > generation, but I don't think this particular namespace declaration > should be there unless you declared it somewhere else. Is that > particular declaration problematic for you? > > -Erik > > Alexander Zatko wrote: >> It looks like the oxf:sql is not handling nested groups correctly >> (possibly I do not understand the intended behavior). There are 2 >> issues I noticed: >> 1) the nesting is wrong. For each order "purchaseorder-group" there >> should be one or more "order" groups containing one or more "details" >> 2) not sure why is the processor geenrating the empty namespace >> declaration whenever an attribute is generated. >> For example - <details xmlns:T_ID="" T_ID="130623"> >> Alex >> The processor config snippet: >> <sql:result-set> >> <orders> >> <sql:row-iterator> >> <sql:group column-name="purchaseordernumber"> >> <purchaseorder-group> >> <sql:attribute name="purchaseordernumber"> >> <sql:get-column-value type="xs:string" >> column-name="purchaseordernumber"/> >> </sql:attribute> >> <sql:member> >> <order> >> <company> >> <sql:get-column-value >> type="xs:string" column-name="company"/> >> </company> >> <podate> >> <sql:get-column-value >> type="xs:decimal" column-name="podate"/> >> </podate> >> <rshdate> >> <sql:get-column-value >> type="xs:decimal" column-name="rshdate"/> >> </rshdate> >> <status> >> <sql:get-column-value >> type="xs:decimal" column-name="status"/> >> </status> >> <complete> >> <sql:get-column-value >> type="xs:decimal" column-name="complete"/> >> </complete> >> <sql:group column-name="T_ID"> >> <details> >> <sql:attribute name="T_ID"> >> <sql:get-column-value >> type="xs:decimal" column-name="T_ID"/> >> </sql:attribute> >> <sql:member> >> <detail> >> < ordered> >> <sql:get-column-value >> type="xs:decimal" column-name="ordered"/> >> </ordered> >> <invoiced > >> <sql:get-column-value >> type="xs:decimal" column-name="invoiced"/> >> </invoiced > >> <shipped > >> <sql:get-column-value >> type="xs:decimal" column-name="shipped"/> >> </shipped > >> </detail> >> </sql:member> >> </details> >> </sql:group> >> </order> >> </sql:member> >> </purchaseorder-group> >> </sql:group> >> </sql:row-iterator> >> </orders> >> </sql:result-set> >> resulting XML snippet: >> <orders> >> <purchaseorder-group xmlns:purchaseordernumber="" >> purchaseordernumber="0369593"> >> <order> >> <company>Test Inc.</company> >> <podate>20050504</podate> >> <rshdate>20050513</rshdate> >> <details xmlns:T_ID="" T_ID="130621"> >> <detail> >> <ordered>8</ordered> >> <invoiced>4</invoiced> >> <shipped>4</shipped> >> </detail> >> <status>810</status> >> <complete>Y</complete> >> </details> >> <order> >> <company>Test Inc.</company> >> <podate>20050504</podate> >> <rshdate>20050513</rshdate> >> <detail> >> <ordered>8</ordered> >> <invoiced>4</invoiced> >> <shipped>4</shipped> >> </detail> >> <order> >> <company>Test Inc.</company> >> <podate>20050504</podate> >> <rshdate>20050513</rshdate> >> <detail> >> <ordered>8</ordered> >> <invoiced>4</invoiced> >> <shipped>4</shipped> >> </detail> >> <order> >> <company>Test Inc.</company> >> <podate>20050504</podate> >> <rshdate>20050513</rshdate> >> <detail> >> <ordered>8</ordered> >> <invoiced>4</invoiced> >> <shipped>4</shipped> >> </detail> >> </order> >> <order> >> <company>Test Inc.</company> >> <podate>20050504</podate> >> <rshdate>20050513</rshdate> >> <details xmlns:T_ID="" T_ID="130623"> >> <detail> >> <ordered>8</ordered> >> <invoiced>8</invoiced> >> <shipped>8</shipped> >> </detail> >> <status>810</status> >> <complete>Y</complete> >> </details> >> </order> >> </order> >> </order> >> </order> >> </purchaseorder-group> >> </orders> > > > -- > 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 -- 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 |
Free forum by Nabble | Edit this page |