Click to See Complete Forum and Search --> : Converting XML into XHTML and beyond
apeine
05-31-2004, 11:51 AM
I have a list of sites in an XML file, with name, web designer, link and site's description, and all those sites are external ones. Using XSLT, I succeeded at converting it into XHTML, and it is shown fine on screen.
I also have a list of internal link to other pages in my site, which is shown at the right side of the screen. All pages in my site have this internal link list. As I am worried on future upgrades, I want to embed this XHTML file into my XSLT file, so I'll have to update only one file with links!!!
I've tried <object>, <iframe> and even javascript (using document.write), but nothing has worked. And my free server offers no other language support (ASP, PHP, PERL or whatever).
Please help...:confused:
lillu
06-03-2004, 08:23 AM
Hi,
Use CDATA sections to escape (X)HTML markup to be interpreted by the XSLT processor.
You can include a whole (x)html page or between the <![CDATA[ ]]> tags anywhere in your XML document. The following XHTML snippet will be output as is and be diplayed in your browser as XHTML.
<![CDATA[
<img src="image.gif" alt="This is my image" />
]]>
HTH,
Lillu
apeine
06-03-2004, 10:54 AM
Lillu, I guess I haven't explained my problem correctly (or haven't understood your explanation correctly). Please follow the links below
This one (http://apj.web1000.com/xml/index.html) leads to my main page, and I want all pages to have the same look and the same menu on the side. But I don't want to modify every page that has links everytime I do some modifications to my site. In this case, I use a .js file with document.write methods to write the text on screen. The advantage is that using javascript inherits the CSS from the main page.
On this other one (http://apj.web1000.com/xml/index.xml) I have a list of external links, and it is converted to XHTML using XSLT. The entire page is blank, and I found out that it happens because of the document.write method (on Firefox - in IE 6, the page is not loaded). I also tried the <object> and <iframe> tags, but none work. This link (http://apj.web1000.com/xml/indexmod.xml) shows how the page should work. Is there anyway to embed XHTML files into a XSLT file?
BTW, nice site of yours ;)
lillu
06-04-2004, 07:57 AM
HI apeine,
Thank for your comment on my site...
I can't see any difference between the two sites, the one that doesn't work and the other one that does.
Can you show me how far you got in the code so that I can offer more help and make sure we are talking about the same thing?
Regards,
Lillu
apeine
06-04-2004, 08:16 AM
Well, Lillu, content from both XML files are almost the same, but they call different XSLT files. On the same directory those files lie, you can call index.xsl and indexmod.xsl, and you can see that in the first one I call a js funtion (lincar - which uses document.write method), and in the other one, this function call is ommited. And the HTML file (index.html) is self-explanatory.
And thanks for your fast response :cool: