Re: parsed entites

Subject: Re: parsed entites
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Nov 1999 16:46:14 -0500
At 99/11/17 13:20 -0800, Alexandra Morgan wrote:
As I understand it, entities have to be declared inside the DOCTYPE. But my stylesheets don't have a DTD. Can I have a DOCTYPE without having a DTD?

It isn't a problem to have a DOCTYPE without a DTD.


When I work with the text output method, I usually create a &nl; entity to emit line feeds in my output as follows:

<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nl "&#xd;&#xa;">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version="1.0">

<xsl:output method="text"/>

<xsl:template match="/">
  <xsl:text>&nl;</xsl:text>
</xsl:template>

</xsl:stylesheet>


You can also have partial DTDs ... a common XSLT processing requirement for well-formed documents is to recognize which attribute of elements is of type ID (because there is nothing special conferred on attributes that are *named* ID).


To communicate this information regarding the source file to the stylesheet, the following can be added to the source:

<!DOCTYPE custsummary [
<!ATTLIST cust custNbr ID #REQUIRED>
]>
<custsummary>
......

I hope this helps.

............ Ken


-- G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995) Web site: XSL/XML/DSSSL/SGML services, training, libraries, products. Practical Transformation Using XSLT and XPath ISBN 1-894049-02-0 Next instructor-led training: 1999-12-05/06, 1999-12-07, - 2000-02-27/28, 2000-05-11/12, 2000-05-15


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread