[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Empty object


Subject: Re: [xsl] Empty object
From: scott gabelhart <swgabel@xxxxxxxxxxxx>
Date: Wed, 28 Jan 2004 10:57:10 -0500

David Carlisle wrote:

I am using a xsd in my stylesheet.



An XSLT1 system won't make any use of an XSD schema. (Or do you mean the schema reference is in the source file rather than in the stylesheet?)



I have only developed stylesheets that either have a DTD or xsd; but not both combined.



You can reference both, an XSLT1 system will ignore the schemaLocation reference whether or not a dtd is used, but the xml parser reading the stylesheet will parse a <!DOCTYPE dtd declaration and process any entity declarations in the internal subset, and in most cases also entities declared in the external subset of the dtd.

If you use an entity such as nbsp then you have to have a DTD as
otherwise the file is not well formed XML and can not be used by any XML
aplication, xslt in particular.

From your previous message it appears that your system was transforming
the undefined entity reference &nbsp; into the text "nbsp" if it was
doing that, rather than giving a fatal error and not producing any
output at all, then it was not conforming to the XML specification.

However if what you want is to generate a nbsp in the output you don't
need a schema or dtd in the stylesheet: just use the character reference
&#160;

David




Dave,

my input xml file has <OBJECT attribute=x..blah>&nbsp;</OBJECT>

I added to my xml input file <!DOCTYPE nbsp [<!ENTITY nbsp "&nbsp;">]> right before my root element declaration
<WITAGLIB xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\DPXML\wiservice.xsd"> now when I open my xml file I don't get undeclared entity....nbsp.. Great


How do I declare this same doctype in my stylesheet that already has my xsd declared?



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



Current Thread
Keywords