xsl-list
[Top] [All Lists]

Re: Getting Entity File Names

2003-10-23 15:09:06
Hi Betty,

At 05:27 PM 10/23/2003, you wrote:
There is a kicker - I thought of that also!  The files themselves don't
reference the DTD but they do contain ISO characters and not UNICODE
characters.

Oh what a drag. (You mean they include friendly ISO entity references such as &_ldquo; and not the Unicode reference for the character? Meaning the file won't parse standalone?)

I guess I could include the ISO character sets in my XSLT.  That would
probably be the quickest way to do it.

Unfortunately declaring entity sets for the stylesheet has no bearing on the parsing of the documents.

 It would also be easier if there
were only one title per file.  Somewhere in those files, there are 3 extra
titles.

A many-to-one table such as

<file><filename>foo333.xml</filename>
  <title>Section 333A</title>
  <title>Section 333B</title>
  <title>What I Did on My Summer Vacation</title>
</file>

would still let you get from "What I Did on My Summer Vacation" to "foo333.xml".

As for the problem with the entity references, I think you're going to have to normalize them away (an identity transform would do it). Your problem is a deep one, having to do with the fact that you are trying to work with two different scopes at once (two different notions of what your "document" consists in, i.e. each individual file or the aggregation of all of them). In order to take advantage of XML's lexical features such as entity references, you need to have a single scope: you can't have a DOCTYPE declaration at two levels of the system at once.

This may show why entity references for file transclusion is a Bad Thing, and we should use XInclude or an analogous mechanism. (Eliot...?)

Which may not be impossible for you. If instead of entity references to parsed entities, you had "file transclusion" PIs or XInclude elements, then all the information you need about your files is available inside XSLT. Of course, your parser won't do your file aggregation for you anymore: but the whole problem here is that the parser is doing that too well and thoroughly -- once the files are aggregated into a single document, it's very hard to see them anymore in their disaggregated form.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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



<Prev in Thread] Current Thread [Next in Thread>