Trademark Logo XSLTC Design
unparsed-entity-uri()
Apache Foundation Xalan Project Xerces Project Web Consortium Oasis Open

unparsed-entity-uri()

(top)

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.

(top)

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().

(top)