[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: parsed entites

Subject: Re: parsed entites
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Nov 1999 16:46:14 -0500
Re: parsed entites
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.