logolineright
bottomhttp://xml.apache.org/http://www.apache.org/http://www.w3.org/
join
Overview
separator
Compiler design
separator
Whitespace
xsl:sort
Keys
Comment design
separator
lang()
Unparsed entities
separator
If design
Choose|When|Otherwise design
Include|Import design
Variable|Param design
separator
Runtime
separator
Internal DOM
Namespaces
separator
Translet & TrAX
XPath Predicates
Xsltc Iterators
Xsltc Native API
Xsltc TrAX API
Performance Hints
close
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().



dot
Copyright © 2004 The Apache Software Foundation. All Rights Reserved.