Re: html/named entities

2002-12-27 Thread Kip Hampton
On Thursday 26 December 2002 10:54 pm, S Woodside wrote:

snip/

 Instead I just want to be able to
 pass through my entities like copy, and so on without any hassle. I
 don't want to have to use xsl:text blahblahblahamp;copy;/xsl:text
 and other ugly constructions like that, or have to create length
 doctype declarations and so on.

This is a bit like, I'm hungry, but I don't want to have to resort to all 
that nasty chewing and swallowing to solve the problem. . . ;-

The common HTML character entities just work in browsers because those 
entities are a predictable, well-defined part of the HTML DTD. DTDs are *how* 
character entities are defined.

Point is: if you want to use character entities beyond the tiny set internal 
to XML (amp;, etc) you will have to use doctype declarations-- no way around 
it. The good news is that you don't need create messy inlined DTDs in every 
document or stylesheet, just create a basic DTD that contains the entities 
you'll need and point to that DTD via the SYSTEM identifier (or use the 
PUBLIC identifier and make it part of your local catalog). For example:

!DOCTYPE xsl:stylesheet SYSTEM html_entities.dtd

will import the entities contained in html_entities.dtd file for use in the 
XSLT stylesheet containing that external DTD.

Help at all?

-kip

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: html/named entities

2002-12-27 Thread Tod Harter
There is no real way of avoiding creating internal DTD declarations for your 
HTML entities (I guess you could use an external DTD and thus declare them 
all once...). Given that they never change I long ago incorporated them into 
the boilerplate for my final XSLT output stylesheets and forgot about it... 

Anyway, the internal DTD subset IS the convenience feature for doing what you 
want. Maybe it would be nice if XSLT's HTML output mode just assumed this, 
but it doesn't, thus the minor inconvenience.

On Friday 27 December 2002 01:54 am, S Woodside wrote:
 Hi I'm happily converting my website over to axkit and have encountered
 this IMHO very annoying aspect of XML/XSLT - that I can't use named
 entities that are the default (X)HTML set without all kind of
 non-trivial crap.

 I understand that there are lots of fancy uses for entities in XSLT
 that is completely different from HTML. However it seems that mostly
 these are also accessible through XSLT functions and so I am not
 interested in that (should I be??). Instead I just want to be able to
 pass through my entities like copy, and so on without any hassle. I
 don't want to have to use xsl:text blahblahblahamp;copy;/xsl:text
 and other ugly constructions like that, or have to create length
 doctype declarations and so on.

 Help?

 simon

 ---
 www.simonwoodside.com


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Tod Harter
Giant Electronic Brain

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: html/named entities

2002-12-27 Thread Jörg Walter
On Friday, 27. December 2002 07:54, S Woodside wrote:
 Hi I'm happily converting my website over to axkit and have encountered
 this IMHO very annoying aspect of XML/XSLT - that I can't use named
 entities that are the default (X)HTML set without all kind of
 non-trivial crap.

 I understand that there are lots of fancy uses for entities in XSLT
 that is completely different from HTML. However it seems that mostly
 these are also accessible through XSLT functions and so I am not
 interested in that (should I be??). Instead I just want to be able to
 pass through my entities like copy, and so on without any hassle. I
 don't want to have to use xsl:text blahblahblahamp;copy;/xsl:text
 and other ugly constructions like that, or have to create length
 doctype declarations and so on.

Well, as Kip already said, there's no way to get completely around this, but 
maybe this helps:

- cut here -- file document root/dummy.dtd --
!ENTITY nbsp #160;
!ENTITY euro #8364;
- cut here -

And repeat this for any char you want. Go to www.w3.org to fetch the HTML DTD 
and copy out the complete set of entities if you like.

For every XML file (be they stylesheets or document files) which contains some 
named entity, put this line at the very top, right after the ?xml ...? 
line:

!DOCTYPE data SYSTEM /dummy.dtd

And that's it. Quite easy, huh? :-)

-- 
CU
  Joerg

PGP Public Key at http://ich.bin.kein.hoschi.de/~trouble/public_key.asc
PGP Key fingerprint = D34F 57C4 99D8 8F16 E16E  7779 CDDC 41A4 4C48 6F94


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]