[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: multiple paths in the "use" in key....I'm getting

Subject: Re: multiple paths in the "use" in key....I'm getting desperate - please help
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 07 Jul 2005 17:58:41 -0400
xpath multiple paths
Christian,

In XSLT, "and" is a Boolean operator, returning "true" or "false" depending
on the values returned by the operands, when cast to Boolean. This isn't
going to be very useful for defining keys, most of the time.

What you are looking for is probably the "|" operator, which performs a
union of two node-sets. So "blue | green" is the set of all "blue" element
children of the context with all "green" element children.

These are commonly confused because "|" often translates colloquially as
"or" or "and", as in match="blue|green", which matches blue elements, and
also matches green elements, since the elements it matches are all members
of the union set "blue|green" (blue and green children of something). So we
say it "matches blue or green", which is not at all the same thing as XPath
"blue or green", which returns true if one of "blue" or "green" tests true.
Similarly, select="blue|green" selects all the blue children and all the
green children, in a single set.

I hope this helps,
Wendell

At 05:52 PM 7/7/2005, you wrote:
Im getting desperate: I've been fighting this problem for 10 hours now....

And I'm sure the solution is quite simple.

I want to take the address codes in AddressSpecific: (municipalitycode,
streetcode,
streetbuildingIdentifier)
and look them up in the XIaddressSpecific element AND RETURN THE CORRECT
XIaddressSpecificLabelStructure

How do I do that?

I have been trying using keys, with multiple paths in the "use":

      <xsl:key name="ForwardingAddressPostCodeIdentifier"
match="PostCodeIdentifier" use="
../../AddressSpecific/cpr:MunicipalityCode and
../../AddressSpecific/cpr:StreetCode and
../../AddressSpecific/StreetBuildingIdentifier" />
      <xsl:key name="ForwardingAddressDistrictName" match="DistrictName"
use="
../../AddressSpecific/cpr:MunicipalityCode and
../../AddressSpecific/cpr:StreetCode and
../../AddressSpecific/dkcc2:StreetBuildingIdentifier" />
      <xsl:key name="ForwardingAddressFloorIdentifier"
match="FloorIdentifier" use="
../../AddressSpecific/cpr:MunicipalityCode and
../../AddressSpecific/cpr:StreetCode and
../../AddressSpecific/StreetBuildingIdentifier"/>
      <xsl:key name="ForwardingAddressSuiteIdentifier"
match="SuiteIdentifier" use="
../../AddressSpecific/cpr:MunicipalityCode and
../../AddressSpecific/cpr:StreetCode and
../../AddressSpecific/StreetBuildingIdentifier"/>


but the "and" between the paths in the "use" doesn't seem to work. PLEASE HELP ME! I'm going soon nuts

on beforehand thanx

          <ForwardingAddressStructure>
             <AddressSpecific>
                        <MunicipalityCode>0840</MunicipalityCode>
                        <StreetCode>3270</StreetCode>

<StreetBuildingIdentifier>135</StreetBuildingIdentifier>
            </AddressSpecific>
         </ForwardingAddressStructure>

  <XIaddressCollection>
   <XIaddressStructure>
     <xkom:AddressSpecific>
             <MunicipalityCode>0750</MunicipalityCode>
             <StreetCode>3270</StreetCode>
             <StreetBuildingIdentifier>256</StreetBuildingIdentifier>
             <FloorIdentifier>3</FloorIdentifier>
             <SuiteIdentifier>MF</SuiteIdentifier>
     </AddressSpecific>
     <XIaddressSpecificLabelStructure>
             <StreetName>paradisfblevej 5</StreetName>
                  <PostCodeIdentifier>9999</PostCodeIdentifier>
                  <DistrictName>skagen</DistrictName>
     </XIaddressSpecificLabelStructure>
   </XIaddressStructure>
   <XIaddressStructure>
     <AddressSpecific>
            <MunicipalityCode>0840</MunicipalityCode>
            <StreetCode>3270</StreetCode>
            <StreetBuildingIdentifier>135</StreetBuildingIdentifier>
            <FloorIdentifier>2</FloorIdentifier>
            <SuiteIdentifier>TV</SuiteIdentifier>
     </xkom:AddressSpecific>
     <XIaddressSpecificLabelStructure>
                  <StreetName>Danmarksgade 20</StreetName>
                  <PostCodeIdentifier>9000</PostCodeIdentifier>
                  <DistrictName>aalborg</DistrictName>
     </XIaddressSpecificLabelStructure>
   </XIaddressStructure>
 </XIaddressCollection>



/Best regards,
Christian


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.