Jump to content

Putting XML and XSLT to display on web


Mixaalser684

Recommended Posts

I have a HTML page that I've converted to XSL using Dreamweaver, and my XML contents is displayed properly as I like when I preview the XSL page in Dreamweaver.Can somebody tell me how can put my new XSL page to display on the internet, because its not the same format as HTML? What must I do in order to get this to work?

Link to comment
Share on other sites

The easiest way would be to add a reference to the XSLT file from the top of the XML file like:

<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="file.xsl"?>

replacing "file.xsl" with the actual path to the XSLT file of course. And then open the XML file. All XML files with reference to this XSLT file will be transformed by it.

Link to comment
Share on other sites

The easiest way would be to add a reference to the XSLT file from the top of the XML file like:
<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="file.xsl"?>

replacing "file.xsl" with the actual path to the XSLT file of course. And then open the XML file. All XML files with reference to this XSLT file will be transformed by it.

Ok. I've already done that before asking my question, and thanks for answer anyway. But what I really wanted to know is which of these two files will I put as destination in corresponding link on other HTML pages, XML or XSLT? I know I must Update them both, but which of those act as HTML?Just for refference here's my code:XML code:
<?xml version="1.0" encoding="iso-8859-1"?><?xml-stylesheet type="text/xsl" href="dokxsl.xsl"?><dokument><red>Welcome to my personal web page. Here I will share my toughts and ideas with you and I'll enable all interested to know me better. I will offer help to anybody regarding areas known to me.</red><red>This web presentation is not completed yet, so please don't laugh. I'm still in learning process, and I'm doing the design myself.</red><red>Thats it for now. I'll check in when I have something new to share. Bye bye.</red><red>Evo jos jednog probnog reda koji ce biti izbrisan</red><red>I jos jos jedno</red></dokument>

And the XSL. This is Transformed HTML to an XSL:

<?xml version="1.0" encoding="iso-8859-1"?><!-- DWXMLSource="dok.xml" --><!DOCTYPE xsl:stylesheet  [	<!ENTITY nbsp   " ">	<!ENTITY copy   "©">	<!ENTITY reg	"®">	<!ENTITY trade  "™">	<!ENTITY mdash  "—">	<!ENTITY ldquo  "“">	<!ENTITY rdquo  "”"> 	<!ENTITY pound  "£">	<!ENTITY yen	"¥">	<!ENTITY euro   "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/><xsl:template match="/"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"/><title>XML Test</title><link rel="stylesheet" type="text/css"href="styles/main.css" /></head><body><div id="kontejner">	<div id="glevi"><img src="images/gif/glevi.gif" alt="" /></div>	<div id="gdesni"><img src="images/gif/gdesni.gif" alt="" /></div>	<div id="ddesni"><img src="images/gif/ddesni.gif" alt="" /></div>	<div id="dlevi"><img src="images/gif/dlevi.gif" alt="" /></div>	<div id="zaglavlje">		<div id="zagslika"><img src="images/gif/zaglavlje.gif" alt="" />		<div id="zaginfo"><img src="images/gif/homepage.gif" alt="" /></div>		</div>	</div>	<div id="navigacija">		<div id="stilnavigacija">			<div id="navlinkjedan"><a class="navlinkboja" href="omeni_e.html" title="My history">About Me</a></div>			<div id="navlinkdva"><a class="navlinkboja" href="underconstruction_e.html" title="What I do">Interests</a>			</div>			<div id="navlinktri"><a class="navlinkboja" href="mailto:faerunal@yahoo.com" title="Write to Me">Contact Me</a>			</div>		</div></div><div id="sadrzaj">	<div id="sadstil">	<!-- Odavde pocinje XML -->	<xsl:for-each select="dokument/red">	<p>	<xsl:value-of select="."/>	</p>  	</xsl:for-each>	<!-- Ovde se XML zavrsava -->	</div></div><div id="podnozje"><div id="stilpodnozje">	<div id="podlinkjedan"><a class="navlinkboja" href="main_e.html" title="Go to the begining">Homepage</a></div>	<div id="podlinkdva"><a class="navlinkboja" href="mailto:faerunal@yahoo.com" title="Send me E-Mail">Contact Me</a></div></div></div></div></body></html></xsl:template></xsl:stylesheet>

Thanx Boen.

Link to comment
Share on other sites

As I said, "And then open the XML file". You create links to the XML files, since only they actually display anything other than a tree then.Technically speaking, neither the XML or the XSLT file "act" like HTML. The XML file is taken, and by using the XSLT is turned into an HTML (not stored anywhere; just appearing as a result) which is then viewed by the user.But to put it in simple terms - the XML is the one that sort of "acts" like an HTML. Keep your links pointing to the XML files.

Link to comment
Share on other sites

Thanx for clarifying that. I have some other questions:When I preview my XSL page in Dreamweaver it looks as it should be. But when I put a link (just for test purposes) in an HTML file pointing to the XML file (from previous message), and click from browser on that link, he opens me the page but only this time the background of the page is White (instead of black) and there is a right scrollbar (all the other elements are there but page is not the same and thus looks a little bit deformed). So therefore it doesn't look as it should. What must I do to fix that and why is this displayed this way?Also, in both instances (XML and XSL), the DIV that holds the XML data doesn't apply the font styles that are stored in the external CSS file. Why is that, and what must I do to apply the font properly?Thanx.

Link to comment
Share on other sites

What are the contents of the XML and XSLT files? The HTML from which they are derived would also be useful in this case.

Link to comment
Share on other sites

You have them in previous messages, well except the html. Here is everything:Here is the the CSS code:

/* Telo */body { background-color:#000000; overflow: visible;}/* Glavni kontejner */#kontejner{background-color: #FFFFFF;}/* Zaglavlje */#zaglavlje{background-color: #FFFFFF; height: 10%; top: 0px; left: 5%; width: 90%; position: absolute;}	/* Elementi zaglavllja */#zagslika {margin-left: 105px; width: 817px; height: 54px; background-color: #FFFFFF;}#zaginfo{background-color: #FFFFFF; right: 130px; top: 3px; z-index: 2; position: absolute;}/* Navigacija */#navigacija{background-color: #FFFFFF; width: 15%; top: 10%; left:5%; height: 90%; position: absolute; color:#0000FF;}	/* Elementi navigacije */#stilnavigacija {font-family: Arial, Helvetica, sans-serif; font-weight: bold; margin-top: 15%;}#navlinkjedan { border-style: dotted; margin-left: 4%; margin-right: 4%; padding-left: 7%; padding-top: 1%; padding-bottom: 2%; border-color:#000000;}#navlinkdva { border-style: dotted; margin-top: 5%; margin-left: 4%; margin-right: 4%; padding-left: 7%; padding-top: 1%; padding-bottom: 2%; border-color:#000000; }#navlinktri {border-style: dotted; margin-top: 5%; margin-left: 4%; margin-right: 4%; padding-left: 7%; padding-top: 1%; padding-bottom: 2%; border-color:#000000;}/*Sadržaj */#sadrzaj{background-color: #FFFFFF; width: 75%; left: 20%; top: 10%; height: 80%; position: absolute;overflow: auto;}	/* Elementi sadržaja */#sadstil {background-color: #FFFFFF; margin-top: 2%; margin-right:2%; margin-left: 3%;}/* Podnožje */#podnozje{background-color: #FFFFFF; height: 10%; bottom: 0; left:20%;width: 75%; position: absolute;}	/*Elementi podnožja */#stilpodnozje { border-top-style: ridge; font-family:Geneva, Arial, Helvetica, sans-serif; font-size: x-small;}#podlinkjedan {background-color: #FFFFFF; position: absolute; margin-left: 7%; margin-top: 2%; font-weight:bold;}#podlinkdva {background-color: #FFFFFF; position: absolute; margin-left: 20%; margin-top: 2%; font-weight:bold;}/* Linkovi - generalno */a.navlinkboja {color: #0033FF;}a:hover {color: #FF9900}/* Držaci coškova - slike */#glevi {background-color: #FFFFFF; top: 0; width: 50px; height: 50px; left: 5%; position: absolute; z-index: 1;}#gdesni {background-color: #FFFFFF; top: 0; width: 50px; height: 50px; right: 5%; position: absolute; z-index: 1;}#ddesni {background-color:#FFFFFF; bottom: 0; width: 50px; height: 50px; right: 5%; position: absolute; z-index: 1;}#dlevi {background-color: #FFFFFF; bottom: 0; width: 50px; height: 50px; left: 5%; position: absolute; z-index: 1;}/* Stilovi paragrafa */#omenip {font-family: "Comic Sans MS"; font-size: 15px;}#omenih {font-family: "Comic Sans MS";}

Here is the HTML code that uses the above CSS:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /><title>Milan Cvetković - Home Page</title><link rel="stylesheet" type="text/css"href="../styles/main.css" /></head><body><div id="kontejner">	<div id="glevi"><img src="../images/gif/glevi.gif" alt="" /></div>	<div id="gdesni"><img src="../images/gif/gdesni.gif" alt="" /></div>	<div id="ddesni"><img src="../images/gif/ddesni.gif" alt="" /></div>	<div id="dlevi"><img src="../images/gif/dlevi.gif" alt="" /></div>	<div id="zaglavlje">		<div id="zagslika"><img src="../images/gif/zaglavlje.gif" alt="" />		<div id="zaginfo"><img src="../images/gif/homepage.gif" alt="" /></div>		</div>	</div>	<div id="navigacija">		<div id="stilnavigacija">			<div id="navlinkjedan"><a class="navlinkboja" href="omeni_e.html" title="My history">About Me</a></div>			<div id="navlinkdva"><a class="navlinkboja" href="underconstruction_e.html" title="What I do">Interests</a>			</div>			<div id="navlinktri"><a class="navlinkboja" href="mailto:faerunal@yahoo.com" title="Write to Me">Contact Me</a>			</div>		</div></div><div id="sadrzaj">	<div id="sadstil">	<p id="omenip">Welcome to my personal web page. Here I will share my toughts and ideas with you and I'll enable all interested to know me better. I will offer help to anybody regarding areas known to me.</p>	<p id="omenip">This web presentation is not completed yet, so please don't laugh. I'm still in learning process, and I'm doing the design myself.</p>	<p id="omenip">Thats it for now. I'll check in when I have something new to share. Bye bye.</p>	</div></div><div id="podnozje"><div id="stilpodnozje">	<div id="podlinkjedan"><a class="navlinkboja" href="main_e.html" title="Go to the begining">Homepage</a></div>	<div id="podlinkdva"><a class="navlinkboja" href="mailto:faerunal@yahoo.com" title="Send me E-Mail">Contact Me</a></div></div></div></div></body></html>

Here is the XSL which I got by converting the above HTML using Dreamweaver:

<?xml version="1.0" encoding="iso-8859-1"?><!-- DWXMLSource="dok.xml" --><!DOCTYPE xsl:stylesheet  [	<!ENTITY nbsp   " ">	<!ENTITY copy   "©">	<!ENTITY reg	"®">	<!ENTITY trade  "™">	<!ENTITY mdash  "—">	<!ENTITY ldquo  "“">	<!ENTITY rdquo  "”"> 	<!ENTITY pound  "£">	<!ENTITY yen	"¥">	<!ENTITY euro   "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/><xsl:template match="/"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"/><title>XML Test</title><link rel="stylesheet" type="text/css"href="styles/main.css" /></head><body><div id="kontejner">	<div id="glevi"><img src="images/gif/glevi.gif" alt="" /></div>	<div id="gdesni"><img src="images/gif/gdesni.gif" alt="" /></div>	<div id="ddesni"><img src="images/gif/ddesni.gif" alt="" /></div>	<div id="dlevi"><img src="images/gif/dlevi.gif" alt="" /></div>	<div id="zaglavlje">		<div id="zagslika"><img src="images/gif/zaglavlje.gif" alt="" />		<div id="zaginfo"><img src="images/gif/homepage.gif" alt="" /></div>		</div>	</div>	<div id="navigacija">		<div id="stilnavigacija">			<div id="navlinkjedan"><a class="navlinkboja" href="omeni_e.html" title="My history">About Me</a></div>			<div id="navlinkdva"><a class="navlinkboja" href="underconstruction_e.html" title="What I do">Interests</a>			</div>			<div id="navlinktri"><a class="navlinkboja" href="mailto:faerunal@yahoo.com" title="Write to Me">Contact Me</a>			</div>		</div></div><div id="sadrzaj">	<div id="sadstil">	<!-- Odavde pocinje XML -->	<xsl:for-each select="dokument/red">	<p>	<xsl:value-of select="."/>	</p>  	</xsl:for-each>	<!-- Ovde se XML zavrsava -->	</div></div><div id="podnozje"><div id="stilpodnozje">	<div id="podlinkjedan"><a class="navlinkboja" href="main_e.html" title="Go to the begining">Homepage</a></div>	<div id="podlinkdva"><a class="navlinkboja" href="mailto:faerunal@yahoo.com" title="Send me E-Mail">Contact Me</a></div></div></div></div></body></html></xsl:template></xsl:stylesheet>

And here is the XML which is intended to be used as text container for the page (instead putting the text in HTML itself).

<?xml version="1.0" encoding="iso-8859-1"?><?xml-stylesheet type="text/xsl" href="dokxsl.xsl"?><dokument><red>Welcome to my personal web page. Here I will share my toughts and ideas with you and I'll enable all interested to know me better. I will offer help to anybody regarding areas known to me.</red><red>This web presentation is not completed yet, so please don't laugh. I'm still in learning process, and I'm doing the design myself.</red><red>Thats it for now. I'll check in when I have something new to share. Bye bye.</red><red>Evo jos jednog probnog reda koji ce biti izbrisan</red><red>I jos jos jedno</red></dokument>

I hope this is what you asked and I provided what you needed.

Link to comment
Share on other sites

Yes, you did post it before.... seems I need a new pair of eyes :) .For the font, your HTML uses <p> elements with an ID of "omenip", but you don't use this ID in the XSLT file. Replace:

	<xsl:for-each select="dokument/red">	<p>	<xsl:value-of select="."/>	</p>  	</xsl:for-each>

with

	<xsl:for-each select="dokument/red">	<p id="omenip">	<xsl:value-of select="."/>	</p>  	</xsl:for-each>

As for the scrollbar, I don't see such a thing. Whatever the reason, in dreamwaver, while you're in the XSLT file, try to "Preview" it and check out if the source of the preview file is the same as your HTML.

Link to comment
Share on other sites

Yes, you did post it before.... seems I need a new pair of eyes :) .For the font, your HTML uses <p> elements with an ID of "omenip", but you don't use this ID in the XSLT file. Replace:
	<xsl:for-each select="dokument/red">	<p>	<xsl:value-of select="."/>	</p>  	</xsl:for-each>

with

	<xsl:for-each select="dokument/red">	<p id="omenip">	<xsl:value-of select="."/>	</p>  	</xsl:for-each>

Yes, now I was missing a pair of eyes :)
As for the scrollbar, I don't see such a thing. Whatever the reason, in dreamwaver, while you're in the XSLT file, try to "Preview" it and check out if the source of the preview file is the same as your HTML.
Just to be able to see what I mean visit my webpage on <u>milancvetkovic.50webs.com/index.html</u>, and click on Enter link to see how the page should look like, and then on index.html click on XML link to see what am I talking about. My site is not optimized for IE due to the lack of hacking knowledge, try viewing it in Mozzila, there it will be displayed properly.
Link to comment
Share on other sites

Yes, now I was missing a pair of eyes :) Just to be able to see what I mean visit my webpage on <u>milancvetkovic.50webs.com/index.html</u>, and click on Enter link to see how the page should look like, and then on index.html click on XML link to see what am I talking about. My site is not optimized for IE due to the lack of hacking knowledge, try viewing it in Mozzila, there it will be displayed properly.
Strange. It's the opposite case for me. It works in IE(7), but not in Firefox(2).And I think I see the problem with the backgorund. You're using XHTML. When you use XHTML, Firefox renders it as if you had an XHTML file served as "application/xhtml+xml", not "text/html" by which the HTML document is served.And in the new MIME type, at least according to Mozilla, the CSS rules state that background rules should be applied to the "html" element, not "body". At the very first line of your CSS, replace "body" with "html", and you'll see the backgorund.I still have no idea on the scrollbars. Maybe it's again the body thing, but I'm not sure.
Link to comment
Share on other sites

Boen Robot said:Strange. It's the opposite case for me. It works in IE(7), but not in Firefox(2).
I'm using IE 6.0 and Mozilla Firefor 2.008, and Opera 9.50 Alpha. Anyway I fixed the display of my webpage by lowering the total height to 98% and the scrollbars were gone, and now the display is as it should in Mozzila (I don't try to view it in IE anymore :) ) but its not same in Opera. Anyway the next question I wanted to ask is:Can I use one XML document with the same data to display my web pages on two different languages (the text on different languages will be stored in one XML and basically it should be same text)? Can I, and how, acomplish this?P.S. - You have the codes :)
Link to comment
Share on other sites

I'm using IE 6.0 and Mozilla Firefor 2.008, and Opera 9.50 Alpha. Anyway I fixed the display of my webpage by lowering the total height to 98% and the scrollbars were gone, and now the display is as it should in Mozzila (I don't try to view it in IE anymore :) ) but its not same in Opera. Anyway the next question I wanted to ask is:Can I use one XML document with the same data to display my web pages on two different languages (the text on different languages will be stored in one XML and basically it should be same text)? Can I, and how, acomplish this?P.S. - You have the codes :)
You can do it in many ways, but I'd say the easier and more elegant way is by using the server. If your server supports PHP, or any other S3L (see my sig), you can initiate the transformation on the server, and only return the resulting HTML to the browser. The S3L file will be chosing a different XML file, based on a given language setting (say, a variable in the query string), and use the corresponding XML file for the transformaiton. The negotiation itself is further discussed in the PHP forum (and the same logic applies to other S3Ls too).If S3Ls are not an option, you could just have the different XMLs of both languages, and simply place links from one to the other. They'll all use the same stylesheet. What you loose in this case is the ability to auto negotiate the language based on browser preferences, and are forced to use *.xml everywhere as an extension. Also, you're forced to comply with XSLT processor differences across different browsers, whereas when you use it on the server, you don't care, since all browsers get the same resulting HTML.
Link to comment
Share on other sites

Unfortunately I'm using free hosting for now that doesn't support PHP. Is there another way? I made XMLs an XSLs for each instance of page and my site is larger that way.Next question, look at this:XML

<?xml version="1.0" encoding="iso-8859-1"?><?xml-stylesheet type="text/xsl" href="about_me_xsl.xsl"?><dokument><naslov>Short Biography</naslov><red>I was born on June the 1st, 1984 in Aleksinac. I was a student of two elementary schools "Aca Milojevic" and "Ljupce Nikolic". After that I go to electrotechnic school "Nikola Tesla" in Nis. Currently I'm a student of machine-technical coledge in Trstenik.</red><red>Since the movie "The Terminator 2" in the begining of '90-s, i develop great affecion towards computers and their capabilities. In the very begining I loved computer games the most, but later I'm interested in much more serious things. Currently I'm perfecting my knowledge regarding several areas of computer science.</red><red>I like to hang out with people and meet new. I hate egoists and those who do not have the "sence" for others and look only themselves. Unfortunately we live in such time so I can't be mad on them much, but I can tell them to saty away. We will talk more in the future about that who is good and who is bad, but thats all for now.</red><red>I mentioned I was inolved with some "projects", you can learn more about that on Interests page. The projects are mostly my school projects, but not all of them. As I said, I like to prefect beyound the knowing boundrys and needs that satisfy basic criterias.</red><red>Thats all for now. If something new happens in my life I think you need to know I'll share.</red></dokument>

It uses thi XSL:

<?xml version="1.0" encoding="iso-8859-2"?><!-- DWXMLSource="about_me_xml.xml" --><!DOCTYPE xsl:stylesheet  [	<!ENTITY nbsp   " ">	<!ENTITY copy   "©">	<!ENTITY reg	"®">	<!ENTITY trade  "™">	<!ENTITY mdash  "—">	<!ENTITY ldquo  "“">	<!ENTITY rdquo  "”"> 	<!ENTITY pound  "£">	<!ENTITY yen	"¥">	<!ENTITY euro   "€">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" encoding="iso-8859-2" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/><xsl:template match="/"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /><title>Milan Cvetković - About Me</title><link rel="stylesheet" type="text/css"href="../styles/main_styles.css" /></head><body><div id="kontejner">	<div id="glevi"><img src="../images/gif/glevi.gif" alt="" /></div>	<div id="gdesni"><img src="../images/gif/gdesni.gif" alt="" /></div>	<div id="ddesni"><img src="../images/gif/ddesni.gif" alt="" /></div>	<div id="dlevi"><img src="../images/gif/dlevi.gif" alt="" /></div>	<div id="zaglavlje">		<div id="zagslika"><img src="../images/gif/zaglavlje.gif" alt="" />		<div id="zaginfo"><img src="../images/gif/aboutme.gif" alt="" /> </div>		</div>	</div>	<div id="navigacija">	<div id="navgdesni"><img src="../images/gif/gdesni.gif" alt="" /></div>		<div id="stilnavigacija">			<div id="navlinkone"><a class="navlinkboja" href="about_me_xml.xml" title="My history">About Me</a>			</div>			<div id="navlinktwo"><a class="navlinkboja" href="under_construction.html" title="What I do">Interests</a>			</div>			<div id="navlinkthree"><a class="navlinkboja" href="mailto:faerunal@yahoo.com" title="Write to Me">Contact Me</a></div>		</div></div><div id="sadrzaj">	<div id="sadstil">	<!-- Odavde pocinje XML -->	<h3 id="omenih">	<xsl:value-of select="dokument/naslov"/>	</h3>	<xsl:for-each select="dokument/red">	<p id="omenip">	<xsl:value-of select="."/>	</p>  	</xsl:for-each>	<!-- Ovde se XML zavrsava -->	</div></div><div id="podnozje"><div id="stilpodnozje">	<div id="podlinkone"><a class="navlinkboja" href="main_xml.xml" title="Go to the begining">Homepage</a></div>	<div id="podlinktwo"><a class="navlinkboja" href="mailto:faerunal@yahoo.com" title="Send me E-Mail">Contact Me</a></div></div></div></div></body></html></xsl:template></xsl:stylesheet>

What I wanted to know is:If I add one more <naslov> tag in XML document below the last <red> tag, with this XSL formatting that next <naslov> iz not displayed. I know I need to change something in the XSL file for this to be viewed as it should, but I don't know what code should I use? I tried several things but it didn't wrork.

Link to comment
Share on other sites

Instead of using for-each, and/or value-of, create another "xsl:template" that matches the certain element, and do whatever you want on it. From the main template, use "xsl:apply-templates" wherever you expect that template to be applied.Something like:

<xsl:template match="/"><html><head>...</head><body>...<xsl:apply-templates/></xsl:template><xsl:template match="naslov"><h1><xsl:value-of select="."/></h1></xsl:template><xsl:template match="red"><p><xsl:value-of select="."/></p></xsl:template>

Each "naslov" element is going to be mapped to the "h1" element in XHTML. The real power here comes in that the "h1" will appear at each occurance of "naslov" regardless of its position, and that as with for-each, you can do anything at its occurance.But really, unless you need something really special, I suggest you don't create a new type of XML. Rather, use XHTML as the syntax of the XML file, and use XSLT to combine it with the common stuff and all. Look at this site for example. Even if you need something more sophisticated, it's usually possible to use XSLT to deliver that from a source XHTML. For example, I generate "title" attributes for images from the "alt" text, unless the image already has a title.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...