B
barmalini
I have a very basic question but haven't find an ansver yet.
My problem is that I'm given XHTML and a set of XML files.
Lets call them XML1, XML2... XMLn
XHTML contains description of the procedure to be performed by a
technician, an XML contains data related to the procedure.
What I need is that a browser (Mozilla/Firefox in my case) opens the
XHTML, then generates a SVG graph based on XML data and embed it into
the rendered page everytime it sees words "GRAPH# 1", "GRAPH# 2", ...
"GRAPH #n".
Here is an example of content-
XHTML:
<p style=
"margin-left: 0.87in; margin-bottom: 0in; widows: 2; orphans: 2">
<font size="2">3.1 From GRAPH #1:
<font color="#000000"><font face="Courier, monospace"><font
size="2"><b>UL: Transmission Monitoring297359750
- ESDAC, SSDAC1, SSDAC2</b></font></font></font><font color=
"#000000"><font size="2">, ch</font></font>eck if the problem is an
intensity jump (either up or down), or a gradual trend (either up
or down), with one or both of the spot sensor DAC
signals.</font>
</p>
XML:
<ParameterName>MntDynPrfCh1MAZRxRyMax</ParameterName>
<Unit>nm</Unit>
<ValueList>
<elt>
<SampleTime>2004-06-07T16:30:59+02:00</SampleTime>
<Value>4.977778</Value>
</elt>
<SampleTime>2004-06-07T17:08:19+02:00</SampleTime>
<Value>9.308994</Value>
</elt>
<elt>
<SampleTime>2004-06-07T17:12:55+02:00</SampleTime>
<Value>9.014751</Value>
</elt>
<elt>
<SampleTime>2004-06-07T17:22:50+02:00</SampleTime>
<Value>-8.831666</Value>
</elt>
<elt>
<SampleTime>2004-06-07T17:38:30+02:00</SampleTime>
<Value>-9.408116</Value>
</elt>
<elt>
<SampleTime>2004-06-08T12:31:48+02:00</SampleTime>
<Value>-4.769183</Value>
</elt>
<elt>
<SampleTime>2004-06-08T12:44:45+02:00</SampleTime>
<Value>-6.075797</Value>
</elt>
<elt>
<SampleTime>2004-06-16T10:25:55+02:00</SampleTime>
<Value>9.666429</Value>
</elt>
<elt>
<SampleTime>2004-06-17T08:14:49+02:00</SampleTime>
<Value>7.959008</Value>
</elt>
</ValueList>
In my view there should be created an XSLT stylesheet that would copy
the content of all <p> elements into result tree, checking for the word
"GRAPH#" in it, and once it's there-
it should create an SVG based on <SampleTime> and <Value>
of each <elt>. And reference to that stylesheet must be put into XHTML
file.
So this is rather long description of my problem.
What I need is the sketch example of the XSLT, provided that my vision
of the solution is correct.
I must add also that I have no experience with neither XSLT nor
XML, so it was going to be a kind of "Hello World" task for me.
I shell greatly appreciate any possible help regarding my concept of
the solution as well as examples of code that I might
use.
With kind regards
Taras Bahnyuk.
My problem is that I'm given XHTML and a set of XML files.
Lets call them XML1, XML2... XMLn
XHTML contains description of the procedure to be performed by a
technician, an XML contains data related to the procedure.
What I need is that a browser (Mozilla/Firefox in my case) opens the
XHTML, then generates a SVG graph based on XML data and embed it into
the rendered page everytime it sees words "GRAPH# 1", "GRAPH# 2", ...
"GRAPH #n".
Here is an example of content-
XHTML:
<p style=
"margin-left: 0.87in; margin-bottom: 0in; widows: 2; orphans: 2">
<font size="2">3.1 From GRAPH #1:
<font color="#000000"><font face="Courier, monospace"><font
size="2"><b>UL: Transmission Monitoring297359750
- ESDAC, SSDAC1, SSDAC2</b></font></font></font><font color=
"#000000"><font size="2">, ch</font></font>eck if the problem is an
intensity jump (either up or down), or a gradual trend (either up
or down), with one or both of the spot sensor DAC
signals.</font>
</p>
XML:
<ParameterName>MntDynPrfCh1MAZRxRyMax</ParameterName>
<Unit>nm</Unit>
<ValueList>
<elt>
<SampleTime>2004-06-07T16:30:59+02:00</SampleTime>
<Value>4.977778</Value>
</elt>
<SampleTime>2004-06-07T17:08:19+02:00</SampleTime>
<Value>9.308994</Value>
</elt>
<elt>
<SampleTime>2004-06-07T17:12:55+02:00</SampleTime>
<Value>9.014751</Value>
</elt>
<elt>
<SampleTime>2004-06-07T17:22:50+02:00</SampleTime>
<Value>-8.831666</Value>
</elt>
<elt>
<SampleTime>2004-06-07T17:38:30+02:00</SampleTime>
<Value>-9.408116</Value>
</elt>
<elt>
<SampleTime>2004-06-08T12:31:48+02:00</SampleTime>
<Value>-4.769183</Value>
</elt>
<elt>
<SampleTime>2004-06-08T12:44:45+02:00</SampleTime>
<Value>-6.075797</Value>
</elt>
<elt>
<SampleTime>2004-06-16T10:25:55+02:00</SampleTime>
<Value>9.666429</Value>
</elt>
<elt>
<SampleTime>2004-06-17T08:14:49+02:00</SampleTime>
<Value>7.959008</Value>
</elt>
</ValueList>
In my view there should be created an XSLT stylesheet that would copy
the content of all <p> elements into result tree, checking for the word
"GRAPH#" in it, and once it's there-
it should create an SVG based on <SampleTime> and <Value>
of each <elt>. And reference to that stylesheet must be put into XHTML
file.
So this is rather long description of my problem.
What I need is the sketch example of the XSLT, provided that my vision
of the solution is correct.
I must add also that I have no experience with neither XSLT nor
XML, so it was going to be a kind of "Hello World" task for me.
I shell greatly appreciate any possible help regarding my concept of
the solution as well as examples of code that I might
use.
With kind regards
Taras Bahnyuk.