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

RE: [xsl] Capturing the content of declared entities


Subject: RE: [xsl] Capturing the content of declared entities
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 14 Oct 2005 19:36:20 +0100

Entities are all swallowed by the XML parser. The only thing XSLT sees is
the expanded text produced by the parser. I'm afraid XSLT is not a good tool
for looking at XML at this "physical" level.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Carolyn Oliver [mailto:Coliver@xxxxxxxxx] 
> Sent: 14 October 2005 18:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Capturing the content of declared entities
> 
> I've looked through the archives but I can't find anything similar to
> this problem.  I'm trying to get my XSLT to capture the content of the
> entities that are declared in my document.
> 
> My XML file has the DOCTYPE declaration with an entity file 
> declared as
> follows:
> 
> *****
> 
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE task "whatever.dtd" 
> [
> <!ENTITY % entity_pool SYSTEM "../../entities/entity_pool.ent">
> %entity_pool;
> 
> ]>
> <topleveltag>
> ....
> </topleveltag>
> 
> *****
> The entity_pool.ent file then declares a group of entity files as:
> 
> <!ENTITY % file1 SYSTEM "../entities/pools/file1.ent">
> <!ENTITY % file2 SYSTEM "../entities/pools/file2.ent">
> <!ENTITY % file3 SYSTEM "../entities/pools/file3.ent">
> %file1;
> %file2;
> %file3;
> Etc.
> 
> This allows me to only use 1 entity declaration at the top of all my
> files and not the 10 that I have to use and if I add an entity file, I
> only add the declaration into the entity_pool file.
> 
> *****
> My entity files are broken into subject matter.  For example, 
> file1.ent
> may have all of my consumable equipment and is found in the file as:
> 
> <!ENTITY towel "paper towel">
> <!ENTITY cloth "cleaning cloth">
> Etc.
> 
> Capturing the content of declared entities
> 
> I'm trying to get my XSLT to capture the content of the entities that
> are declared in my document.
> 
> My XML file has the DOCTYPE declaration with an entity file 
> declared as
> follows:
> 
> *****
> 
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE task "whatever.dtd" 
> [
> <!ENTITY % entity_pool SYSTEM "../../entities/entity_pool.ent">
> %entity_pool;
> 
> ]>
> <topleveltag>
> ....
> </topleveltag>
> 
> *****
> The entity_pool.ent file then declares a group of entity files as:
> 
> <!ENTITY % file1 SYSTEM "../entities/pools/file1.ent">
> <!ENTITY % file2 SYSTEM "../entities/pools/file2.ent">
> <!ENTITY % file3 SYSTEM "../entities/pools/file3.ent">
> %file1;
> %file2;
> %file3;
> Etc.
> 
> This allows me to only use 1 entity declaration at the top of all my
> files and not the 10 that I have to use and if I add an entity file, I
> only add the declaration into the entity_pool file.
> 
> *****
> My entity files are broken into subject matter.  For example, 
> file1.ent
> may have all of my consumable equipment and is found in the file as:
> 
> <!ENTITY towel "paper towel">
> <!ENTITY cloth "cleaning cloth">
> Etc.
> 
> I know that the entities are being processed by the system 
> because when
> I had an error in 1 of the files, it stopped the process.  The problem
> is that when processor gets through the entities it will not recognize
> in the XML where the entity is being referenced.  My XML using the
> entities like:
> 
> <step>
> <para>Using a &towel;, clean the part.</para>
> </step>
> 
> ****
> Instead of getting the 'paper towel' from the entity, I get an error
> that reads:
> 
> "Cannot load file to XMLDomDocument. A name was started with 
> an invalid
> character"
> 
> *****
> 
> My final output is to an FO but I believe this is an XSLT problem.  My
> XSL-FO (rendering with Antenna House V3.3) does not use anything
> different than <xsl:value-of select="element"> to get the 
> content of the
> field, could that be my problem?  Is what I'm trying to do possible?
> 
> 
> 
> Sincerely,
> Carolyn Oliver
> Systems Analyst
> 
> O'NEIL & ASSOCIATES, INC.
> 495 Byers Rd.
> Miamisburg, Ohio 45342-3662
> 
> Phone: (937) 865-0846 ext. 3024
> Fax: (937) 865-5858
> E-mail: coliver@xxxxxxxxx
> 
> REVOLUTIONIZING DOCUMENTATION >>> POWERING PRODUCT SUPPORT
> 
> 
> **********************************************************************
> Confidentiality Notice
> The information contained in this e-mail is confidential and 
> intended for
> use only by the person(s) or organization listed in the 
> address. If you have
> received this communication in error, please contact the 
> sender at O'Neil &
> Associates, Inc., immediately. Any copying, dissemination, or 
> distribution
> of this communication, other than by the intended recipient, 
> is strictly
> prohibited.
> **********************************************************************


Current Thread
Keywords