http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Overview

Compiler design

Whitespace
xsl:sort
Keys
Comment design

lang()
Unparsed entities

If design
Choose|When|Otherwise design
Include|Import design
Variable|Param design

Runtime

Internal DOM
Namespaces

Translet & TrAX
XPath Predicates
Xsltc Iterators
Xsltc Native API
Xsltc TrAX API
Performance Hints

Credits

Functionality
 

The unparsed-entity-uri() function gives access to declarations of unparsed entities in the DTD of the source document. If the DTD contains the declaration:

    <!ENTITY mom-picture SYSTEM "http://www.home.com/mom.jpg" NDATA JPEG>
  

the expression unparsed-entity-uri('mom-picture') returns an URI for the file mom.jpg.


Implementation
 

Unparsed entities must be gathered from the XML input document at the time when the DOM is built. To achieve this our parser must parse the document DTD (if any) and store all data of type NDATA (not XML data) in a hashtable in the AbstractTranslet object. All the compiled code for this function needs to do is call a method in the translet for retrieving the value for the requested element:

    public String AbstractTranslet.getUnparsedEntity(String entityName);
  

The translet will use the supplied entityName to look up the value in the hashtable and then leave the string value on the stack for the element that called lang().



Copyright © 2003 The Apache Software Foundation. All Rights Reserved.