Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Using xml, xsl, html, cant change font size

Reply
Thread Tools

Using xml, xsl, html, cant change font size

 
 
kmunderwood@charter.net
Guest
Posts: n/a
 
      03-09-2005
I am having trouble changing the font size when extracting xml into an
html web page.
I think it can be done so many ways, that my searches bring up examples
that I am not familiar with.
I am a newbie at xml and xsl

This is my xml("index.xml")page(I can not change this, it comes to me
this way.

<?xml version="1.0" encoding="iso-8859-1" ?>
- <fieldgate ser="6C000D010A0" tag="TTL Bulk Storage Farm" type="full"
devices="all">
<time>19700101-000000</time>
<timezone>0</timezone>
<ff_version>01.02.02-071 20050118</ff_version>
<os_version>3.18</os_version>
<conf>FXA520-AA1A</conf>
- <device id="11183312ee" tag="B05" type="HART">
<u4>C</u4>
<v4>22.22</v4>
<u2>In H2O</u2>
<dev>Cerabar S</dev>
<man>Endress+Hauser</man>
<u1>lb</u1>
<v1>535.91</v1>
<type>HART</type>
- <param>
<t1ch>Bulk Tank B5</t1ch>
<t2ch>Weight in Pounds</t2ch>
<max>43928.00</max>
<min>0.00</min>
</param>
</device>
</fieldgate>

The "device" element repeats 11 more times, and I want to ignore some,
so I am using an "if match" technique.
I just repeat the table for each bulk tank that I want to display.

This is my xsl("index.xsl"):

<?xml version='1.0'?>
<xsl:stylesheet xmlnssl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body>
<table width="800" border="2" bordercolor="#3300CC"
bgcolor="#0099CC">
<tr>
<th>Tank #</th>
<th>Current Level</th>
<th>Temp.</th>
<th>@</th>
</tr>
<xsl:for-each select="fieldgate/device">
<xsl:if match=".[tag='B01']">
<tr>
<td width="200"><xsl:value-of select="tag"/></td>
<td width="200"><xsl:value-of select="v1"/></td>
<td width="200"><xsl:value-of select="v4"/></td>
<td width="200"><xsl:value-of select="u4"/></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

This shows an html page like this:
Tank # CurrentLevel Temp. @
B01 395.47 69.65 F

No matter what I try, the B01, shows the exact same way, or the page
becomes just blank, and shows nothing.


This is my html:

<html>
<body>
<script language="javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("index.xml")

// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("index.xsl")

// Transform
document.write(xml.transformNode(xsl))
</script>

</body>
</html>

If any one can tell me how to do this, and where to place the code, I
would appreciate it.
I see code examples, but dont know where to place it.
I am working off of an xml, xsl tutorial web site, and have had
success, but can not get over the hump of this font size, and perhaps
page colors, etc.

Any help in the right direction would help, even if I should find
another language to learn.

Thx in advance,
Ken

 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-09-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> I am having trouble changing the font size when extracting xml into
> an html web page.


I can't see any attempt to change font size in the code you included.
When HTML is your output format, it would appear to be natural to
use a CSS style sheet for such purposes. You could use CSS either by
including a suitable <link> element into the HTML code or by including
a <style> element into the <head> part of the HTML document, e.g.
<style type="text/css">
th, td { font-size: 90%; }
</style>

--
Yucca, http://www.cs.tut.fi/~jkorpela/
 
Reply With Quote
 
 
 
 
kmunderwood@charter.net
Guest
Posts: n/a
 
      03-10-2005

Jukka K. Korpela wrote:
> (E-Mail Removed) wrote:
>
> > I am having trouble changing the font size when extracting xml into
> > an html web page.

>
> I can't see any attempt to change font size in the code you included.
> When HTML is your output format, it would appear to be natural to
> use a CSS style sheet for such purposes. You could use CSS either by
> including a suitable <link> element into the HTML code or by

including
> a <style> element into the <head> part of the HTML document, e.g.
> <style type="text/css">
> th, td { font-size: 90%; }
> </style>
>
> --
> Yucca, http://www.cs.tut.fi/~jkorpela/



Jukka,
wow, that was simple.
I was not doing something right.

Kiitoksia oikein paljon,
Ken

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing Font, it's Java Font? ot native? how install new font? mttc Java 2 07-03-2009 07:29 PM
cant compile on linux system.cant compile on cant compile onlinux system. Nagaraj C++ 1 03-01-2007 11:18 AM
Firefox - Prevent TextField size change when user changes font size? Wongod HTML 2 10-04-2006 12:26 PM
Windows XP explorer font and font size Lookout Computer Support 0 06-04-2006 02:58 AM
Selecting font size based on available font dave richards HTML 2 02-19-2004 02:47 PM



Advertisments