[xsl] Re:Re:How to simplify the xslt expression for multiple conditions.

Subject: [xsl] Re:Re:How to simplify the xslt expression for multiple conditions.
From: "Yang" <sfyang@xxxxxxxxxxxxx>
Date: Sun, 20 May 2001 18:36:33 +0800
Hi,

Jeni gave me a good suggestion of using two-pass solution to greatly
reduce the tedious xslt coding effort in displying solutions from multiple
conditions
project. Thanks,  Jeni.

However it brings another key technical issue with reusing node-set
and several minor one.  I hope someone can point me directions for this key
one. Thanks.

1.  How to pass RTF around to the javascript function?

    What I did on first pass solution is this;
    pass xml name as param to a named-template
    where xml is used as one of arguments of javascript function,

    step1
    <xsl:call-template name="paging">
    <xsl:with-param name="xml" select="$xmlfile"/>
    ..
    </xsl:call-template>

    step2
    <xsl:template name="paging">
    <xsl:param name="xml"/>
     ..
    <a href="javascript:updaePage('{$xml}'...);">paging</a>

     step3
     function updatePage(xmlfile,..)
     { XMLDOM = new ActiveXObject('Msxml2.FreeThreadedDOMDocument');

      XMLDOM.async = false;

      XMLDOM.load(xmlfile);

       ..
      }

     Since the node-set becomes the document source, how to apply it instead
of xml file
     from the above steps?
     I try to pass vaiable $xmldata from node-set to the named template ;
    <xsl:variable name="xmldata" select="exsl:node-set($rows-rtf)/z:rowset"
/>

     It seems to be entered as an empty node.  So what is the correct
expression for this case?

     In the step 3, since xmlfile is entered as node-set form,
     should I change to XMLDOM.loadXML(xmlfile);   instead of
XMLDOM.load(xmlfile);

   minor issues:

1  I am using msxsl3.  There is no problem for me using msxsl:node-set()
extension functions to convert RTF to a node set.  But I wonder is EXSLT -
Functions  with the coming msxml4 or not?

2  Jeni, I can not figure out the phrase quoted as in your reply;
 ***Even better would be if the first pass could be done earlier in the
 process, so that the XSLT stylesheet only gets the information that it
 actually needs to process, and not loads of extra stuff that it isn't
 interested in.**
 Would you plase be more specific, thanks.   Now I am interpreting it to
normalize
 the attribute data when copy-of into RTF..etc.

3.  by following the idea to work on predicate expression from

    [substring(@SalesOrderNo[$dayID], 12, 2) = $dayID]

    to  number function as
       [number(substring(@SalesOrderNo[$dayID], 12, 2))= number($dayID)]

    it does not work , unless
[not($dayID) or number(substring(@SalesOrderNo[$dayID],12, 2)) =
number($dayID)]
    do I misinterpret the logic?


Thanks helps in advance

Sun-fu Yang

sfyang@xxxxxxxxxxxxx







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


Current Thread