unparsed-entity-public-id


unparsed-entity-public-id

The unparsed-entity-public-id() function gives access to the public identifier of unparsed entities declared in the DTD of the source document.

Changes in 2.0

This function is new in XSLT 2.0.

Signature

Argument

Data Type

Meaning

name

xs:string

Specifies the name of the unparsed entity required. The value of the string should be an XML Name.

Result

xs:string

The public identifier of the unparsed entity with the given name, if there is one. Otherwise, a zero-length string.

Effect

This function operates on the document containing the context node. An error is reported if the context item is undefined, or if it is not a node, or if it is a node in a tree whose root is not a document node.

If the document containing the context node includes an unparsed entity whose name is equal to the supplied string, and if the unparsed entity has a public identifier (signaled by the PUBLIC keyword in XML) then the public identifier is returned. In all other cases, it returns a zero-length string.

Usage

Unparsed entities are one of the more rarely used features of XML; they derive from SGML, and this explains why people who use unparsed entities are also inclined to use public identifiers to refer to them. Public identifiers were designed to tackle the same problem as URNs, namely to provide a way of giving unique names to objects, without becoming locked in to the location where the object can be found. They are often used in conjunction with Oasis catalogs.

Note that it is the public identifier of the unparsed entity that is returned, not the public identifier of the notation named in its NDATA clause. The data model does not provide any information about notations.

Examples

For example, if the DTD contains the declaration:

  <!ENTITY weather-map SYSTEM "weather.jpeg"   PUBLIC "-//MEGACORP//WEATHER/"NDATA JPEG>  

then the expression «unparsed-entity-public-id('weather-map') » returns the public identifier «-//MEGACORP//WEATHER/ » .

See Also

unparsed-entity-uri () in the following section.




XSLT 2.0 Programmer's Reference
NetBeansв„ў IDE Field Guide: Developing Desktop, Web, Enterprise, and Mobile Applications (2nd Edition)
ISBN: 764569090
EAN: 2147483647
Year: 2003
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net