Chapter 3 DynaScript Predefined Objects
The DOMEntity
object inherits
all the properties of the DOMNode
object, as well
as the properties discussed in this section.
DOMEntity.notationName
For unparsed entities, the name of the notation for the entity. For parsed entities this is null.
This XML document has a very simple DTD, consisting only of entity declarations (only the first part of the document is shown).
<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE Customers [
<!ENTITY PQ "Province of Quebec">
<!ENTITY Logo SYSTEM "nautilus.gif" NDATA GIF>
]>
<Customers><Customer><FName>Jessie...
If the parsed XML document is held in a variable named domDoc, this script writes out the notation names of each entity declared in the DTD.
var dtd = domDoc.doctype;
var entlist = dtd.entities
for( iEnt = 0; iEnt < entlist.length; iEnt++ ){
ent = entlist.item(iEnt);
document.writeln( "notationName = " +
ent.notationName );
}
The output of this example is:
notationName = null
notationName = GIF
DOMEntity.publicId
The public identifier associated with the entity, if specified. If the public identifier is not specified, it is null.
This declaration has a public identifier.
<!ENTITY PubLogo PUBLIC "-//MyOrg//GIF Logo//EN" "logo.gif" NDATA GIF>
If this entity declaration is stored in a variable named ent, then the following instructions write out the public identifier of the entity.
document.writeln( "publicId " + ent.publicId );
The output from this example is:
publicId -//MyOrg//GIF Logo//EN
DOMEntity.systemId
The system identifier associated with the entity, if specified. Or null, if not specified.
This XML document has a very simple DTD, consisting only of entity declarations. Only the first part of the document is shown.
<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE Customers [
<!ENTITY PQ "Province of Quebec">
<!ENTITY Logo SYSTEM "nautilus.gif" NDATA GIF>
]>
<Customers><Customer><FName>Jessie...
If the parsed XML document is held in a variable named domDoc, this script writes out the notation names of each entity declared in the DTD.
var dtd = domDoc.doctype;
var entlist = dtd.entities
for( iEnt = 0; iEnt < entlist.length; iEnt++ ){
ent = entlist.item(iEnt);
document.writeln( "systemId = " +
ent.systemId );
}
This example is:
systemId = null
systemId = nautilus.gif
Copyright © 1999 Sybase, Inc. All rights reserved. |
![]() |