Hi,
I've got a standard XML file with appropriate XSL. I'm using PHP5 to transform the XML+XSL into an XHTML Strict document (.htm).
Everything is fine but I'm looking for some ways to include a portion of the XSL file as dynamic at the point of the XHTML creation.
As part of the XSL file I have defined the navigational menu, I'd like to change this menu dependant on the location of the page in the site
For example, if you were in page 2b you would see the second instance rather than the first (illustrated badly below).
home
- page 1
- page 2
- page 3
home
- page 1
- page 2
- - page2a
- - page2b
- page 3
Generating the menu in itself is very easy, however, how do I then get this information in to the XSL.
Previously using the Sabltron (boo hiss) extension you could load the XSL file from a variable so I used to create the XSL file with a {MENU} identifer and str_replace it out inbetween loading the XSL from file into a variable and loading the variable into the transform method.
How is everyone else doing this?
I thought about either defining the menu in XML and combining two XML files into one XSL but it seems over the top.
I also thought about the above method using the new XSLT extension but I can't find any information on loading the XSL from a variable rather than importing it via DOM.
Any other suggestions?
Thanks
Andrew
On another note, how did we ever manage with sablotron? It was so slow in comparisson to the new extension. Thanks Guys!
I've got a standard XML file with appropriate XSL. I'm using PHP5 to transform the XML+XSL into an XHTML Strict document (.htm).
Everything is fine but I'm looking for some ways to include a portion of the XSL file as dynamic at the point of the XHTML creation.
As part of the XSL file I have defined the navigational menu, I'd like to change this menu dependant on the location of the page in the site
For example, if you were in page 2b you would see the second instance rather than the first (illustrated badly below).
home
- page 1
- page 2
- page 3
home
- page 1
- page 2
- - page2a
- - page2b
- page 3
Generating the menu in itself is very easy, however, how do I then get this information in to the XSL.
Previously using the Sabltron (boo hiss) extension you could load the XSL file from a variable so I used to create the XSL file with a {MENU} identifer and str_replace it out inbetween loading the XSL from file into a variable and loading the variable into the transform method.
How is everyone else doing this?
I thought about either defining the menu in XML and combining two XML files into one XSL but it seems over the top.
I also thought about the above method using the new XSLT extension but I can't find any information on loading the XSL from a variable rather than importing it via DOM.
Any other suggestions?
Thanks
Andrew
On another note, how did we ever manage with sablotron? It was so slow in comparisson to the new extension. Thanks Guys!