Who can help on XSL-Stylesheets.

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Who can help on XSL-Stylesheets.

Post by rjversluis » 18.05.2008, 09:00

Hi,

does someone has the knowledge on how to create a XSL-Stylesheet to convert the layout XML on the fly to HTML?

dadolphs
Posts: 1426
Joined: 22.02.2008, 06:45
Location: Solingen
Contact:

Post by dadolphs » 18.05.2008, 09:10

Hi Rob,

are you thinking about some kind of reporting functionality?

Regards,
Dirk

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 18.05.2008, 09:45

Yes, to make the plan.xml viewable with a web browser.
I just looked at

http://de.selfhtml.org/xml/darstellung/ ... spiele.htm

and I think this is possible. We do not need a dtd file.

dadolphs
Posts: 1426
Joined: 22.02.2008, 06:45
Location: Solingen
Contact:

Post by dadolphs » 18.05.2008, 09:52

Hi Rob,

I wrote this post and then looked at my mails from SF ... :oops:

Using XSL is good and flexible idea, but, as already commented in the feature request, I would incorporate such a functionality in the GUI. 8)

Regards,
Dirk

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 18.05.2008, 09:59

I think the Rocgui is already fat enough and it would be a good opportunity for others to write such a XSL Stylesheet without coding C/C++.
If the stylesheet is available at rocrail.net you can view with one click a layout file someone posted in the forum...;-)

dadolphs
Posts: 1426
Joined: 22.02.2008, 06:45
Location: Solingen
Contact:

Post by dadolphs » 18.05.2008, 10:07

rjversluis wrote:I think the Rocgui is already fat enough
Hmmm, just another button ....
rjversluis wrote: and it would be a good opportunity for others to write such a XSL Stylesheet without coding C/C++.
You got me wrong, I would go with the XSL approach and for example just filter the corresponding objects before formatting them with XSL.
rjversluis wrote: If the stylesheet is available at rocrail.net you can view with one click a layout file someone posted in the forum...;-)
I agree completely. The solution would be comparable to schemes and I would expect new reports coming from other users.

Regards,
Dirk

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 18.05.2008, 10:11

The button on every Index tab has also it's charm...
And the XSL could be small; just for one object type...

But the basic Q remains: Who can write XSL-Stylesheets?

dadolphs
Posts: 1426
Joined: 22.02.2008, 06:45
Location: Solingen
Contact:

Post by dadolphs » 18.05.2008, 10:29

rjversluis wrote: But the basic Q remains: Who can write XSL-Stylesheets?
... raising carefully a finger ... :oops:

My understanding is that we need a parser like Saxon to get to HTML. How would we deal with this requirement?
All examples on the mentioned page are using DTDs. Where do you see the hint that a DTD is not required?

Regards,
Dirk

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 18.05.2008, 10:33

No, we do not need a DTD and no need for a parser.

just unpack the example and open the xml file with firefox: "Open file..."
You do not have the required permissions to view the files attached to this post.

dadolphs
Posts: 1426
Joined: 22.02.2008, 06:45
Location: Solingen
Contact:

Post by dadolphs » 18.05.2008, 10:57

Okaaaaaaaaaaaayyyyy ....

I would call that a dirty trick! :wink: And it's trick which is working with IE too ... :lol:

The disadvantage of this approach is that you have to name the XSL within the XML (which would be in a first instance the plan file).
The approach would work, if we create on the fly an extract of the overall XML file and incorporate the XSL call. But what about showing related information? Show details of sensors used in streets ...

I do not know a way at the moment to use this technique with **one** plan file and different reports (blocks, feedbacks, etc.) without changing the XML.

A parser would allow that:

Code: Select all

saxon plan.xml sensors.xsl >sensors.html
or

Code: Select all

saxon plan.xml streets.xsl >streets.html

Do I miss something?

Regards,
Dirk

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 18.05.2008, 11:11

It is maybe too heavy to handle it by XSL...
My knowledge of the XSL is too little to give some hints/advice on how to show a variable number of child nodes...

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 18.05.2008, 11:12

Maybe I should stick with the method the server already provide and improve it.

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 18.05.2008, 11:24

But I wonder how to document it at all with so many attributes and child nodes.

For example the block:

http://www.rocrail.net/doc/rocrail-wrap ... en.html#bk

You need one page for every block to document it all...

dadolphs
Posts: 1426
Joined: 22.02.2008, 06:45
Location: Solingen
Contact:

Post by dadolphs » 18.05.2008, 11:28

Hi Rob,
rjversluis wrote:Maybe I should stick with the method the server already provide and improve it.
I still believe that the XSL functionality would be sufficient for simple reports (as they're implemented in the server today) like 'show me a well formatted table of all sensors' and a possible approach would be:

- button which creates a new XML file with the required subset of objects
- insert a call to the predefined XSL file in a subdirectory
- open the new (temporary) XML with the default browser or ... (see SF)

The most comfortable solution would be that users are able to define their own name of the style sheet for each object.

Users, knowing XSL, would be able to adapt the OOTB style sheets and share these files with the community.

I don't give up ... :wink:

Regards,
Dirk

rjversluis
Site Admin
Posts: 42319
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 19.05.2008, 09:48

Also a nice example on how to show attributes:
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Documentation”