# I need some xsql/xslt/xml help.

**URL:** https://boards.straightdope.com/t/i-need-some-xsql-xslt-xml-help/297287
**Category:** Factual Questions
**Created:** [April 1, 2005, 7:39pm UTC](https://boards.straightdope.com/t/i-need-some-xsql-xslt-xml-help/297287 "2005-04-01T19:39:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Bruce\_Daddy](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@Bruce\_Daddy](https://boards.straightdope.com/u/Bruce_Daddy)
#### Post date: [April 1, 2005, 7:39pm UTC](https://boards.straightdope.com/t/i-need-some-xsql-xslt-xml-help/297287/1 "2005-04-01T19:39:14Z")

</div>

I hate to post this here but I posted it on some forums dedicated to this stuff and got no help. I also tried google but I don’t really know what to google for.

Scenario: User will select several ‘styles’. From these styles, I want to return information about each. To over simplify it, here is an example, (in xml):

\<Style 1\>  
-\<UPC A\>  
\</Style\>  
\<Style 2\>  
-\<UPC B\>  
-\<UPC C\>  
\</Style\>

* * *

Here is my (simplified, again) query (xsql, Oracle 8(?)):

select  
Style,  
UPC

from STYLES, UPC  
where instr(‘EJLU2505~EJMU2494~’ ,STYLES.Style) != 0 and  
instr(‘EJLU2505~EJMU2494~’ ,UPC.Style) != 0 and STYLES.Style = UPC.STYLE(+)

* * *

Which returns:  
EJLU2505 | UPC1  
EJLU2505 | UPC2  
EJMU2494 | UPC3

* * *

So far so good. The problem is the XML (simplified):  
\<!–WRONG–\>  
\<ROWSET\>

- \<ROW num=“1”\>  
\<STYLE\>EJMU2494\</STYLE\>  
\<UPC\>1\</UPC\>  
\</ROW\>
- \<ROW num=“2”\>  
\<STYLE\>EJLU2505\</STYLE\>  
\<UPC\>2\</UPC\>  
\</ROW\>
- \<ROW num=“3”\>  
\<STYLE\>EJLU2505\</STYLE\>  
\<UPC\>3\</UPC\>  
\</ROW\>  
\</ROWSET\>

* * *

\<!-- RIGHT! --\>

\<ROWSET\>

- \<ROW num=“1”\>  
\<STYLE\>EJMU2494\</STYLE\>  
\<UPC\>1\</UPC\>  
\</ROW\>
- \<ROW num=“2”\>  
\<STYLE\>EJLU2505\</STYLE\>  
\<UPC\>2\</UPC\>  
\<UPC\>3\</UPC\>  
\</ROW\>  
\</ROWSET\>

* * *

I realize the string of styles is probably not the best way to go, but I don’t know another way to pass them. My way worked great until it was decided that the information needed to be grouped by Style, not by the sub categories (UPC, etc).

If there was a way to just loop though the xml in my xslt, that would be fine too, but I don’t know how to do that (for-each?).

How far off base am I? Suggestions? I really need to get this working, I’ll sponsor you or a Member of your choice for some help. Thanks.
