problem using treemenu in xsl

Explorer like navigation tree for websites
Navigationsbaum für Internet Auftritte.
Post Reply
thandel

problem using treemenu in xsl

Post by thandel »

The treemenu does not show up when I include it in a html page coming from a xsl transformation.
I can reproduce the error:
the inclusion of the js file with following code does not work
<script language="javascript" src="treemenu.js"/>

following code works fine:
<script language="javascript" src="treemenu.js"></script>

I am not able to generate the working code from a xsl file.
Is there a workaround for that problem ?

Thanks Thomas
User avatar
Hans
Site Admin
Posts: 77
Joined: 16 Dec 2005, 16:52
Location: Germany
Contact:

My assumption

Post by Hans »

Hi Thomas,

XSL (Extensible style sheet language) is used to format XML styles in a universal way. It is somehow comparable with xml over html, as i understand it in my incomplete cognition. Please correct me if I'm false.

The standard for html is opening and closing a token with separated commands, e.g. open a token with <command> insert any content and use </command> to close. In xml only some commands are allowed to open and close integrated, e.g. <br /> to code an empty linebreak in xml instead of <br> with html. But the <script>-command must be closed using </script> to be compatible with xml and html (e.g. see http://www.selfhtml.org).

To be compatible with all browsers TreeMenu uses the standard xml/html-specification according your second example: <script...>...</script>. Your first example <script ... /> is not html compatible and thus is logically consistent that your browser does not support this xsl-transformation. For me it seems that your xsl-transformation is not regular.

I hope the above explanations can help you to solve your problem. If my above explanations are faulty, please forgive me and correct my suggestions. Your thread was my first contact to xsl.

Thank you for using TreeMenu. I send you my best wishes and perhaps you could report your experiences within this forum.

Yours, Hans
Your forum admin
thandel

Post by thandel »

I have <script...>...</script> in my xsl style sheet, but after the transformation I have <script.../> and there is nothing I can do to change that behavior. So I hoped that there is a workaround for the script to run with <script.../> syntax because other scripts are also running with it, but I not able to see the difference in Javascript.

In my Test HTML Page I am very satisfied with the treemenu it is fast and flexible.

Thomas.
User avatar
Hans
Site Admin
Posts: 77
Joined: 16 Dec 2005, 16:52
Location: Germany
Contact:

No TreeMenu problem

Post by Hans »

Dear Thomas,

i really don't know why your xsl-transformation is creating code incompatible with xml/html. By creating <script.../> the browsers obviously are hindered to include any javascript-code, not only the code of TreeMenu. You may check this by trying to include any other javascript-code.

Because 'TreeMenu.js' is not loaded at all, there can be no workaround within TreeMenu. You will have to create a workaround for your xsl-transformation (i don't know how you do your transformation) to create browser compatible code enabling you to load javascript.

Maybe you alternatively can try to insert the complete content of 'treemenu.js' inline within your menu-file, e.g increase the content of 'menu_eng.html' as shown below:

Code: Select all

...
<script type="text/javascript">
<!--
Paste the content of treemenu.js here
tree = new treemenu(...);
...
document.write(tree);
//-->
</script>
You then also could try to include all other files 'config.js', 'default.js' and the '*.css'-files the same way (e.g. see http://www.selfhtml.org).

I hope this helps.

Best wishes.
Hans
Your forum admin
Post Reply