• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

xsl:value-of

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help me !!
What is wrong with this style sheet ?
When I apply this to the XML document given It does not print the urgent on IE?
What am I missing?
Please help me this is urgent..
Thanks in advance.

my xml document,
<Meeting>
<date/>
<Subject> URGENT </Subject>
</Meeting>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Root template -->
<xsl:template match="/">
<html>
<head>
Meeting.xml
</head>
<body>
<xsl:value-of select="Subject"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead the output in browser is
Subject
and not the content of Subject(i.e. URGENT)
???
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You do not use old version of MSXML? Anyway, try this
<xsl:value-of select="Meeting/Subject"/>
instead of
<xsl:value-of select="Subject"/>
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Map!! It worked...
Thanks a lot. :-)
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Map,
<ul>
<xsl:for-each select="Meeting/Open_Issues">
<li> <xsl:value-of select="Issues"/> /li>
</xsl:for-each>
</ul>
now this portion of my style sheet is not taking all the issues in this xml document but overwriting the latest one?
Am I missing something??
<Open_Issues>
<issues> aaaa <issues>
<issues> bbbb </issues>
<issues> cccc </issues>
</open_issues>
what I want is unordered(bulleted) list of all
aaaa
bbbb
cccc
whereas I am getting just aaaa
???
Thanks in advance
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That�s because your <xsl:for-each> statement will be executed for each "open_issues" element, and there is only one, so it will work once and output the first "issues" element. Instead, put
<xsl:template match="Meeting">
...
<ul>
<xsl:for-each select="Meeting/open_issues/issues">
<li> <xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
...
</xsl:template>
- that should work
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes It worked.
This is really cool site.
Thanks once again. :-)

Tell me if my way of writing style sheet is wrong . I mean I just felt I am using so much of HTML , Can I do it in some other better way. But I dont think I am wrong.
Please tell me if I need to imrpove on the way I am doing it.
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did not find anything horribly wrong in your XSLT, so all I can tell are general recommendations XSLT is a functional language and it employes different programming paradigm. For this reason, many of our habitual tricks will not work. It is worth to spend some time, to read a book (Khun Yee Fung�s �XSLT� is good) and to learn concepts. Otherwise a lot of frustration will be our the only reward... After that, to look at classical patterns of XSLT thinking is very useful. Unfortunately, it will take a while to get used to think in a different way, but it means we will think better!
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can u help me to clarify my doubt?
Whatever I am doing here needs me to use HTML tags.
Is xsl:fo an alternative to achieve all this???
Please help
Thanks
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to use HTML tags because you need to convert your XML into HTML to show it in a browser. I am not sure XSL:FO is a good alternative. One thing, it is said to be more complex than XSLT. Next, it requires special tools to be rendered. I am not aware of browsers level of support for XSL:FO, but even if last versions support it, what if your clients use old versions? HTML is still much more reliable media.
HTML inclusions in XSL stylesheets are normal practice if these stylesheets are intended for "XML to HTML" conversion. Nothing wrong with it

[This message has been edited by Mapraputa Is (edited June 14, 2001).]
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Map for your valuable time.
I will read the xslt book you suggested.
Thanks
 
Do you want ants? Because that's how you get ants. And a tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic