Extract Para's using XLL

Subject: Extract Para's using XLL
From: Rhonda Fischer <rhonda@xxxxxxxxxxxxxx>
Date: Thu, 01 Jun 2000 08:21:31 +0000
AIM:
----

* I have an xml document containing paragraphs,
    an amalgamation of contracts.
* I have to extract a selection of paragraphs based
   on two criteria (hyperthetical example):

    (1) If our customer wants us to deliver their goods
            (yes or no) therefore paragraphs explaining
           Terms of delivery need to be included in their
            contract
    (2)   And the type of contract this customer has
             with us, rental, purchase or rent-to-buy


Using XLINK and XPOINTER to solve:
-----------------------------

* I have been exploring the possibility of using a control
    document that based on the conditional outcome of
    the criteria will define a range in the xml document
    to be copied/embedded into the resulting xml document.
* I would like to enquire the viability of using XLL to
   solve this problem. I have done quite a bit of reading
   and have a sketchy outline of ideas.


Idea ONE:
--------

<!-- Declare a global variable determining criteria
          This will probably need to be manually changed
           unless there is a better way to achieve?? -->

<xsl:param name='contractType'>rental</xsl:param>
<xsl:param name='deliverUs'>true</xsl:param>

<xsl:choose>
    <xsl:when
             test="@contractType='rental'"
             <xsl:choose>
                  <xsl:when
                       test="@deliverUs='true'"

                            <!-- Specify a range using xpointer
                               ** assume I can assign an id to
                               an element, perhaps using the name
                               attribute????

                               ** how is this xpointer syntax used with
the
                               xlink syntax??? I am interested in the
                               show="embed" and actuate="auto"
                               attributes of xlink -->

                          xpointer(id("sec2.1")/descendant::Para[last()]

                          to id("sec2.2")/descendant::Para[last()])
                          xpointer(id("sec3.4")/descendant::Para[last()]

                          to id("sec6.9")/descendant::Para[last()]

                            <!-- Am I able just to list off sections
                             of the original document. I want to ensure
                             the resulting xml is composed of fragments
                             of the original document not a whole
                             page of user activated hot spots -->

                   </xsl:when>
                   <xsl:otherwise>
                           <!-- ** Different sections specified - XLL
                            Exclude paragraphs re: delivery terms
                             Include all para's pertaining to
                             rental contract -->
                   </xsl:otherwise>
             </xsl:choose>
    </xsl:when>
     <xsl:when
              test="@contractType='purchase'"
              ...... same algorithm as above just
              ...... different XLL
    </xsl:when>
</xsl:choose>


DTD:
----

<!ELEMENT Para ANY
  <!ATTLIST Para
        xlink:form CDATA #FIXED extended
         href            CDATA #REQUIRED
         show          CDATA ("new" | "replace" |
                                  "embed") "embed"
        actuate        CDATA ("user"|"auto") "auto">



Idea TWO:
--------

* still endeavoring to understand the interworkings
   of xlink and xpointer?? Considering out-of-line
   links ?

<arguement xlink:form="extended">
         <theme xlink:form="locator" href="thought1">
          <theme xlink:form="locator" href="thought2">
</arguement>

<para id="thought1">
    A block of text
</para>

<para id="thought2">
    A block of text
</para>


Assistance with the above would be much appreciated.
Direction to clear and concise examples I would also
very much appreciate.

Thank you kindly.

Best Regards
Rhonda


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread