Click to See Complete Forum and Search --> : XML/XSLT and DTD


imperial
05-12-2006, 11:06 PM
Hi,
I'm new with xml/xslt and when I installed Dreamweaver8 and using xslt basic page a code came
out and seems like its DTD (i'm new with it either), anyways the code is

<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>

.
.
.


from the pages of <a href="http://www.google.com.ph/search?hl=en&q=DTD+tutorial+entity&btnG=Search&meta=">tutorial from google</a>
I couldn't find any helpful tutorial that is a Real Application of some sort because its all basic tutorial. Hope you could help me
in finding a step by step procedure on how to use this ENTITY thing in a real apps (a line or two will do :) ).

Stephen Philbin
05-12-2006, 11:39 PM
It's just a small internal subset. It's just declaring those entities for use in the document later on. A quick read of section 2 of the XML 1.0 Recommendation (http://www.w3.org/TR/2004/REC-xml-20040204/#sec-documents) through to section 2.9 should give you a bit of a better idea of why it is there (sections 2.8 and 2.9 in particular).

imperial
05-13-2006, 05:56 AM
I got now the idea and thank you Stephen, but one thing , is their any real type kind of web application that uses this? hope you could give an example or should I say a source code out of this ? :) ( please spoonfeed me)

Stephen Philbin
05-14-2006, 08:03 PM
I wouldn't say and web application as such would do much with it directly. It's just a means of making one sequence of characters represent another in accordance with the rules of the language you have created and are described in the DTD.

For example: <!ENTITY euro "€"> just declares an entity for use in the document that is related to this declaration. It might be specified in the DTD directly (like it is in the example you gave), or it might be in an external subset so may documents can relate to it. It just declares that when the XML parser encounters the declared entity "&euro;", it should replace it with the "€" symbol.