[KLUG Members] Re: Possible with XPATH/XSLT?

John Holland members@kalamazoolinux.org
Fri, 7 Feb 2003 21:22:07 -0500


First, is it possible to normlize the source XML?  Is this layout fixed
or is it possible to re-design?  In particular, it appear that two
related objects [part] and [vendor] are mixed in one tag. How about:


<part>
  <vendor/>
  <vendor/>
  <vendor/>
</part
<part>
  <vendor/>
  <vendor/>
  <vendor/>
  <vendor/>
  <vendor/>
</part

That more accurately describes the relationship and would make it much
easier to apply the XSLT.


On Wed, Feb 05, 2003 at 04:24:21PM -0500, Adam Tauno Williams wrote:
> What I want is to "select" for the report (XML->XSLT->Document) each part where
> there not a corresponding "part" (oem+native) from "vendor" 801.  So for the
> first "sku" 913397 I'd 'pick' both parts, but for the second "sku" 913304" I'd
> only pick the last one since all the other oem+native combinations have a
> matching part from vendor 801.
> 
> Possible?
> 
> <?xml version="1.0" standalone="yes"?>
> <catalogreport>
>   <stockingunit sku="913397" crosscount="2" lowvendor="653" lownet="20.63"
> v413list="0" v413net="0" v560list="0" v560net="0" v011list="0" v011net="0"
> v100list="0" v100net="0">
>     <part oem="555" native="72900236" vendor="345" description="GASKET"
> net_price="27.874" list_price="36.2"/>
>     <part oem="689" native="72900236" vendor="653" description="GASKET"
> net_price="20.63" list_price="36.2"/>
>   </stockingunit>
>   <stockingunit sku="913304" crosscount="10" lowvendor="616" lownet="28.38"
> v413list="0" v413net="0" v560list="0" v560net="0" v011list="79.7"
> v011net="38.95" v100list="79.7" v100net="38.95">
>     <part oem="555" native="77700115" vendor="345" description="RUBBER-SQUEEGEE,
> INNER" net_price="61.369" list_price="79.7"/>
>     <part oem="555" native="77700115" vendor="100" description="SQUEEGEE-RUBBER
> INNER" net_price="38.95" list_price="79.7"/>
>     <part oem="555" native="77700115" vendor="011" description="SQUEEGEE-RUBBER
> INNER" net_price="38.95" list_price="79.7"/>
>     <part oem="555" native="77700115" vendor="801" description="BLADE"
> net_price="37.8" list_price="42.5"/>
>     <part oem="555" native="77700115" vendor="969" description="BLADE"
> net_price="40.15" list_price="40.15"/>
>     <part oem="689" native="77700115" vendor="653" description="RUBBER-SQUEEGEE,
> INNER" net_price="79.7" list_price="79.7"/>
>     <part oem="689" native="77700115" vendor="801" description="BLADE"
> net_price="37.8" list_price="42.5"/>
>     <part oem="689" native="77700115" vendor="969" description="BLADE"
> net_price="40.15" list_price="40.15"/>
>     <part oem="834" native="ALNSG83751URE" vendor="616" description="BLADE"
> net_price="28.38" list_price="0.0"/>
>   </stockingunit>
> </catalogreport>

--------------------------------------------------------------------
John Holland 
john@zoner.org
http://www.zoner.org