Problem in Mozilla for Displaying text from XSL variable

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem in Mozilla for Displaying text from XSL variable

Parag.gupta.iiita
I have one problem regarding displaying text from XML file.
I have a XSL variable named $p = (0 0 0) (0.82 0 0) (1.63 -0.01 0)
(2.63 -0.01 0) (3.63 -0.01 0) (4.63 -0.01 0) (5.63 -0.02 0) (6.63
-0.02 0) (7.63 -0.02 0) (8.6 -0.02 0)
This line contains X,Y,Z coordinates of 10 points.
for displaying each coordinate in a separate line.Like this....
(0 0 0)
(0.82 0 0)
(1.63 -0.01 0)
(2.63 -0.01 0)
(3.63 -0.01 0)
(4.63 -0.01 0)
(5.63 -0.02 0)
(6.63 -0.02 0)
(7.63 -0.02 0)
(8.6 -0.02 0)

i made a template

<xsl:call-template name="break">
<xsl:with-param name="str" select="$p"/>
<xsl:with-param name="breaker" select="'('"/>
</xsl:call-template>
<xsl:template name="break">
<xsl:param name="str"/>
<xsl:param name="breaker"/>
<xsl:choose>
<xsl:when test="substring-after($str, $breaker) = ''"/>
<xsl:value-of select="$str"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(substring-before($str, $breaker),
$breaker)"/>
<br/>
<xsl:call-template name="break">
<xsl:with-param name="str" select="substring-after($str, $breaker)"/>
<xsl:with-param name="breaker" select="$breaker"/>
</xsl:call-template>
</xsl:otherwise
</xsl:template>

for more clearity go to this link
http://bytes.com/forum/thread786674.html

NOW THE PROBLEM is this, that in IE 6.0 its displaying all the points
in different row, but when i open that file in mozilla,it displays all
the points in a single row. can any one hlep me that how can it
display each point in different row in mozilla?
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Martin Honnen-3
[hidden email] wrote:

> NOW THE PROBLEM is this, that in IE 6.0 its displaying all the points
> in different row, but when i open that file in mozilla,it displays all
> the points in a single row. can any one hlep me that how can it
> display each point in different row in mozilla?

Can you post the URL to a test case?
Or at least show us some context, we need to see whether your XSLT
stylesheet generates HTML or XHTML and whether for instance for XHTML it
is ensured that the 'br' element is in the XHTML namespace
http://www.w3.org/1999/xhtml.


--

        Martin Honnen
        http://JavaScript.FAQTs.com/
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Jonas Sicking-2
In reply to this post by Parag.gupta.iiita
> <xsl:call-template name="break">
> <xsl:with-param name="str" select="$p"/>
> <xsl:with-param name="breaker" select="'('"/>
> </xsl:call-template>
> <xsl:template name="break">
> <xsl:param name="str"/>
> <xsl:param name="breaker"/>
> <xsl:choose>
> <xsl:when test="substring-after($str, $breaker) = ''"/>
> <xsl:value-of select="$str"/>
> </xsl:when>
> <xsl:otherwise>
> <xsl:value-of select="concat(substring-before($str, $breaker),
> $breaker)"/>
> <br/>
> <xsl:call-template name="break">
> <xsl:with-param name="str" select="substring-after($str, $breaker)"/>
> <xsl:with-param name="breaker" select="$breaker"/>
> </xsl:call-template>
> </xsl:otherwise
> </xsl:template>
>
> for more clearity go to this link
> http://bytes.com/forum/thread786674.html
>
> NOW THE PROBLEM is this, that in IE 6.0 its displaying all the points
> in different row, but when i open that file in mozilla,it displays all
> the points in a single row. can any one hlep me that how can it
> display each point in different row in mozilla?

Most likely the <br/> that you are creating is in the wrong namespace.
Are you by any chance creating an XHTML result page? If so, you need to
make sure that all created elements are in the XHTML namespace.

I would strongly recommend using HTML as output, unless you know all the
differences between XHTML and HTML.

/ Jonas
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Parag.gupta.iiita
On May 27, 10:41 pm, Jonas Sicking <[hidden email]> wrote:

> > <xsl:call-template name="break">
> > <xsl:with-param name="str" select="$p"/>
> > <xsl:with-param name="breaker" select="'('"/>
> > </xsl:call-template>
> > <xsl:template name="break">
> > <xsl:param name="str"/>
> > <xsl:param name="breaker"/>
> > <xsl:choose>
> > <xsl:when test="substring-after($str, $breaker) = ''"/>
> > <xsl:value-of select="$str"/>
> > </xsl:when>
> > <xsl:otherwise>
> > <xsl:value-of select="concat(substring-before($str, $breaker),
> > $breaker)"/>
> > <br/>
> > <xsl:call-template name="break">
> > <xsl:with-param name="str" select="substring-after($str, $breaker)"/>
> > <xsl:with-param name="breaker" select="$breaker"/>
> > </xsl:call-template>
> > </xsl:otherwise
> > </xsl:template>
>
> > for more clearity go to this link
> >http://bytes.com/forum/thread786674.html
>
> > NOW THE PROBLEM is this, that in IE 6.0 its displaying all the points
> > in different row, but when i open that file in mozilla,it displays all
> > the points in a single row. can any one hlep me that how can it
> > display each point in different row in mozilla?
>
> Most likely the <br/> that you are creating is in the wrong namespace.
> Are you by any chance creating an XHTML result page? If so, you need to
> make sure that all created elements are in the XHTML namespace.
>
> I would strongly recommend using HTML as output, unless you know all the
> differences between XHTML and HTML.
>
> / Jonas

actually my template is this..

<xsl:template name="break">
        <xsl:param name="str"/>
        <xsl:param name="breaker"/>
        <xsl:choose>
          <xsl:when test="substring-after($str, $breaker) = ''">
            <xsl:variable name="last"><xsl:value-of select="$str"/></
xsl:variable>   </xsl:when>
          <xsl:otherwise>
          <xsl:variable name="s"><xsl:value-of
select="concat(substring-before($str, $breaker),$breaker)"/></
xsl:variable>

<table border="0" cellspacing="0" cellpadding="0" width="300">
                <tr>
                <td align="left" width="100">
<xsl:variable name="tmpStr_01" select="(substring-after($s,'('))"/>
                                                                                                                                                        <xsl:variable name="x"
select="number(substring-before($tmpStr_01,' '))"/>
                                                                                                                                                        <font color="black" face="Verdana, Arial,
Helvetica, sans-serif" size="2">
                                                                                                                                                        <xsl:value-of select="format-number($x, '0.00')"/>
                                                                                                                                                        </font>
                        </td>
                        <td align="left" width="100">
        <xsl:variable name="tmpStr_02" select="(substring-
after($tmpStr_01,' '))"/>
                                                                                                                                                        <xsl:variable name="y"
select="number(substring-before($tmpStr_02,' '))"/>
                                                                                                                                                        <font color="black" face="Verdana, Arial,
Helvetica, sans-serif" size="2">
                                                                                                                                                        <xsl:value-of select="format-number($y, '0.00')"/>
                                                                                                                                                        </font>
                        </td>
                        <td align="left" width="100">
        <xsl:variable name="tmpStr_03" select="(substring-
after($tmpStr_02,' '))"/>
                                                                                                                                                        <xsl:variable name="z"
select="number(substring-before($tmpStr_03,')'))"/>
                                                                                                                                                        <font color="black" face="Verdana, Arial,
Helvetica, sans-serif" size="2">
                                                                                                                                                        <xsl:value-of select="format-number($z, '0.00')"/>
                                                                                                                                                        </font>
                         </td>
                </tr>
                  </table>

             <xsl:call-template name="break">
                <xsl:with-param name="str" select="substring-
after($str, $breaker)"/>
                <xsl:with-param name="breaker" select="$breaker"/>
             </xsl:call-template>
          </xsl:otherwise>
          </xsl:choose>
      </xsl:template>

Now in IE 6.0 it shows all the points in different line but in Mozilla
it shows all the points in a single line.
so can anybody help me that how can be this work for Mozilla aslo.
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Martin Honnen-3
[hidden email] wrote:

> Now in IE 6.0 it shows all the points in different line but in Mozilla
> it shows all the points in a single line.
> so can anybody help me that how can be this work for Mozilla aslo.

Can you post a URL where we can see the problem?
Or at least show us the root element of your stylesheet and any
xsl:output you have.
We need to see whether you create XHTML or HTML and we need to see any
namespaces involved.


--

        Martin Honnen
        http://JavaScript.FAQTs.com/
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Parag.gupta.iiita
On May 30, 10:07 pm, Martin Honnen <[hidden email]> wrote:

> [hidden email] wrote:
> > Now in IE 6.0 it shows all the points in different line but in Mozilla
> > it shows all the points in a single line.
> > so can anybody help me that how can be this work for Mozilla aslo.
>
> Can you post a URL where we can see the problem?
> Or at least show us the root element of your stylesheet and any
> xsl:output you have.
> We need to see whether you create XHTML or HTML and we need to see any
> namespaces involved.
>
> --
>
>         Martin Honnen
>        http://JavaScript.FAQTs.com/

Hi Martin
can u give me your mail id so that i can send you my XML files along
with XSL file??
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Martin Honnen-3
[hidden email] wrote:

> can u give me your mail id so that i can send you my XML files along
> with XSL file??

i don't want your files by email. Post a URL or post the relevant stuff
(xsl:stylesheet element and xsl:output elements here).


--

        Martin Honnen
        http://JavaScript.FAQTs.com/
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Parag.gupta.iiita
On Jun 2, 5:13 pm, Martin Honnen <[hidden email]> wrote:

> [hidden email] wrote:
> > can u give me your mail id so that i can send you my XML files along
> > with XSL file??
>
> i don't want your files by email. Post a URL or post the relevant stuff
> (xsl:stylesheet element and xsl:output elements here).
>
> --
>
>         Martin Honnen
>        http://JavaScript.FAQTs.com/

Ok,
Problem has been resolved.
Now i have one more problem
in my XML file i have CData like this

<college name="JDSVM" id="121" >
      <![CDATA[
             53           26100
]]>
      <Comment>
        <![CDATA[
 front jounce bumper

]]>
</college>

in my XSL file, for taking the value of name and iid, i used
<xsl:value-of select="college/@name"/>
<xsl:value-of select="college/@id"/>

now for selecting the above CDATA section i used
<xsl:value-of select="college/."/>

but this line show CDATA sections along with Comment part, it looks
like this...
53           26100  front jounce bumper

can u tell me how can we select only <b> 53           26100 </b> part?
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Martin Honnen-3
[hidden email] wrote:

> <college name="JDSVM" id="121" >
>       <![CDATA[
>              53           26100
> ]]>
>       <Comment>
>         <![CDATA[
>  front jounce bumper
>
> ]]>
> </college>
>
> in my XSL file, for taking the value of name and iid, i used
> <xsl:value-of select="college/@name"/>
> <xsl:value-of select="college/@id"/>
>
> now for selecting the above CDATA section i used
> <xsl:value-of select="college/."/>
>
> but this line show CDATA sections along with Comment part, it looks
> like this...
> 53           26100  front jounce bumper
>
> can u tell me how can we select only <b> 53           26100 </b> part?

   <xsl:value-of select="college/text()[1]"/>

--

        Martin Honnen
        http://JavaScript.FAQTs.com/
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt
Reply | Threaded
Open this post in threaded view
|

Re: Problem in Mozilla for Displaying text from XSL variable

Parag.gupta.iiita
Thanks Martin Honnen...
can you tell me why here we wrote [1]?
and what this text() do?
if not possible then provide me any link ....

Thanks again :)
_______________________________________________
dev-tech-xslt mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xslt