File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Product and Other Certifications and the fly likes Grasping Numbers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Grasping Numbers" Watch "Grasping Numbers" New topic

Grasping Numbers

Srinivas Rallapalli

Joined: May 20, 2003
Posts: 18
i have an xml page, i have written an xsl for it. in the xml page i have some elements called <bits> in this bits element again there may be 2 or 1 elements like this:<start> or <start></start><end></end>
there may be more sumber of start elements in the same bits elements, or more number of their combinations,
like this there may be lot of combinations.
my xsl code for taking numbers in this is:
<xsl:for-each select="Bits/Start">
<xsl:variable name="actual_pos"><xsl:value-of select="position()"/>
<xsl:variable name="start_val">
<xsl:value-of select="."/>
<xsl:variable name="DStartEnd">
<xsl:when test=" contains($start_val, '(' )">
<xsl:value-of select="substring-after($start_val, '(' )"/>:
<xsl:value-of select="$start_val"/>:
<xsl:when test="../End[position()=$actual_pos]">
<xsl:variable name="end">
<xsl:value-of select="../End[position()=$actual_pos]"/>
<xsl:when test="contains($end, ')' )">
<xsl:value-of select="substring-before($end, ')')"/>
<xsl:value-of select="$end"/>
<xsl:value-of select="$start_val"/>
<xsl:call-template name="addElement2">
<xsl:with-param name="DStartEnd" select="$DStartEnd"/>
<xsl:with-param name="name" select="../../Field"/>
<xsl:with-param name="access" select="../../AccType"/>
<xsl:with-param name="DescLongName" select="../../Desc/LongName"/>
<xsl:with-param name="DescText" select="../../Desc/DescriptionText"/>
it is working for all the conditions except for the 4th and 5th conditions.
i found that it is due to, the first start element is looking for the end element, after the first start element if again start element is there, it is not taking care of the second start element but it is taking the end element of second start element.
so please give me an idea, how to do for the elements like 4th and 5th.

Edit Comment:
Disabled smiles....;)
- madhav
[ September 05, 2003: Message edited by: Madhav Lakkapragada ]
I agree. Here's the link:
subject: Grasping Numbers
jQuery in Action, 3rd edition