public class XDocumentImpl extends XEntityImpl implements XDocument
Modifier and Type | Field and Description |
---|---|
private boolean |
isSuppressNamespaceProcessing
The flag to maintain suppress namespace processing.
|
private java.lang.String |
schemaPaths
Schema paths locations variable
|
private org.w3c.dom.Document |
xdoc
The real document to assign with handle.
|
IS_INVALID_NODE
isValid
name, nextSibling, prevSibling
instProc
Constructor and Description |
---|
XDocumentImpl()
Default constructor.
|
XDocumentImpl(org.w3c.dom.Document xdoc)
Associate this X-DOCUMENT resource with an existing document
|
Modifier and Type | Method and Description |
---|---|
logical |
addSchemaLocation(character namespace,
character location)
Adding new match pair for namespace schema and physical file location.
|
logical |
createNode(handle hChild,
character name,
character type)
Creating the new node within the current Document object.
|
logical |
createNode(handle hChild,
character name,
java.lang.String type)
Creating the new node within the current Document object.
|
logical |
createNode(handle hChild,
java.lang.String name,
character type)
Creating the new node within the current Document object.
|
logical |
createNode(handle hChild,
java.lang.String name,
java.lang.String type)
Creating the new node within the current Document object.
|
logical |
createNodeNamespace(handle hChild,
character uri,
character name,
character type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
character uri,
character name,
java.lang.String type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
character uri,
java.lang.String name,
character type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
character uri,
java.lang.String name,
java.lang.String type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
java.lang.String uri,
character name,
character type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
java.lang.String uri,
character name,
java.lang.String type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
java.lang.String uri,
java.lang.String name,
character type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
java.lang.String uri,
java.lang.String name,
java.lang.String type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
integer |
getChildNum()
Gets the number of child for the current one.
|
logical |
getDocumentElement(handle hRoot)
Getting the root node for the current document.
|
character |
getEncoding()
Get encoding
|
org.w3c.dom.Node |
getNode()
Getting the Element backend object for this XEntity.
|
character |
getNonamespaceSchemaLocation()
Gets the value of the XML schema file for elements with no namespaces.
|
handle |
getOwnerDocument()
Getting the Document the current reference belongs to.
|
character |
getPublicId()
This method returns the public ID of the external DTD from which an XML document was
generated.
|
character |
getSchemaLocation()
Determines the list of namespace/location pairs of an XML Schema file to validate
against.
|
character |
getSchemaPath()
A delimiter-separated list of directory paths used to locate the XML Document Type
Definition (DTD) associated with a particular XML document.
|
logical |
getSuppressNamespaceProcessing()
Indicates if the namespace processing is suppressed or not.
|
character |
getSystemId()
Returns the system ID of the external DTD from which an XML document was generated.
|
logical |
importNode(handle xNodeRef,
handle xSourceNodeRef,
boolean deep)
Creating the new node within the current Document object.
|
logical |
importNode(handle xNodeRef,
handle xSourceNodeRef,
logical deep)
Creating the new node within the current Document object.
|
logical |
initializeDocumentType(character namespaceUri,
character rootNodeName,
character publicId,
character systemId)
Creates a new XML document, initializes the document based on the referenced DTD,
and creates its root node.
|
logical |
initializeDocumentType(character namespaceUri,
java.lang.String rootNodeName,
character publicId,
character systemId)
Creates a new XML document, initializes the document based on the referenced DTD,
and creates its root node.
|
logical |
initializeDocumentType(java.lang.String namespaceUri,
character rootNodeName,
java.lang.String publicId,
java.lang.String systemId)
Creates a new XML document, initializes the document based on the referenced DTD,
and creates its root node.
|
logical |
initializeDocumentType(java.lang.String namespaceUri,
java.lang.String rootNodeName,
java.lang.String publicId,
java.lang.String systemId)
Creates a new XML document, initializes the document based on the referenced DTD,
and creates its root node.
|
private void |
invalidReadWriteModeError(java.lang.String attribute)
Process and display invalid node error.
|
logical |
load(character mode,
java.lang.Object source,
boolean validate)
Loading X-Document form file or memptr sources.
|
logical |
load(character mode,
java.lang.Object source,
logical validate)
Loading X-Document form file or memptr sources.
|
logical |
load(java.lang.String mode,
java.lang.Object source,
boolean validate)
Loading X-Document form file or memptr sources.
|
logical |
load(java.lang.String mode,
java.lang.Object source,
logical validate)
Loading X-Document form file or memptr sources.
|
character |
name()
Get the
name attribute of handle. |
protected boolean |
resourceDelete()
Delete the resource.
|
logical |
save(character mode,
java.lang.Object target)
Saving X-Document to file or stream or memptr object.
|
logical |
save(java.lang.String mode,
java.lang.Object target)
Saving X-Document to file or stream or memptr object.
|
void |
setEncoding(character encoding)
Get encoding
|
void |
setEncoding(java.lang.String encoding)
Sets the new value of the encoding attribute for the given SAX-Writer object.
|
void |
setNamespacePrefix(character prefix)
Setter for NAMESPACE-PREFIX attribute.
|
void |
setNonamespaceSchemaLocation(character location)
Setting the new value for the nonamespace-schema-location attribute.
|
void |
setSchemaLocation(character schemaLocation)
Determines the list of namespace/location pairs of an XML Schema file to validate
against.
|
void |
setSchemaPath(character schemaPath)
A delimiter-separated list of directory paths used to locate the XML Document Type
Definition (DTD) associated with a particular XML document.
|
void |
setSuppressNamespaceProcessing(boolean suppress)
Redefines whether the namespace processing is suppressed or not.
|
void |
setSuppressNamespaceProcessing(logical suppress)
Redefines whether the namespace processing is suppressed or not.
|
appendChild, commonDomError, getChild, getChild, getNamespacePrefix, getNamespaceURI, getNumChildren, getSubType, getUniqueID, insertBefore, invalidNodeError, isInitialized, isXEntityHandle, isXNodeHandle, isXNodeHandleInitialized, removeAttribute, removeAttribute, removeChild, replaceChild, setNamespacePrefix, setNamespaceURI, setNamespaceURI, setNode, setNodeToHandle, setSubType, setSubType, unsupportedDomError
addSchemaLocation, addSchemaLocation, addSchemaLocation, hasNextSibling, hasPrevSibling, invalidArgumentAssignError, invalidArgumentError, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, setNonamespaceSchemaLocation, valid
delete, firstResource, firstResource, getHead, getNextSibling, getNextSibling, getPrevSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameReadOnly, hasParent, hasPrivateData, interlink, isChained, lastResource, lastResource, moveInChain, name, name, readOnlyError, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData
getResourceType, id, id, implicitDeletion, instantiatingProcedure, invalidAttribute, setInstantiatingProcedure, type, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendChild, getChild, getChild, getNamespacePrefix, getNumChildren, insertBefore, removeChild, replaceChild, setNamespacePrefix
addSchemaLocation, addSchemaLocation, addSchemaLocation, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, setNonamespaceSchemaLocation
id, id, unknown, valid
getUniqueID
getNamespaceURI, setNamespaceURI, setNamespaceURI
getSubType, setSubType, setSubType
getResourceType
private org.w3c.dom.Document xdoc
private boolean isSuppressNamespaceProcessing
private java.lang.String schemaPaths
public XDocumentImpl(org.w3c.dom.Document xdoc)
xdoc
- The real document to assign with handle.public XDocumentImpl()
public org.w3c.dom.Node getNode()
getNode
in class XEntityImpl
protected boolean resourceDelete()
resourceDelete
in class XEntityImpl
true
if the resource was deleted.public void setNamespacePrefix(character prefix)
setNamespacePrefix
in interface XEntity
setNamespacePrefix
in class XEntityImpl
prefix
- The new value of the NAMESPACE-PREFIX attribute.public character name()
name
attribute of handle.name
in interface Nameable
name
in class XEntityImpl
public logical createNode(handle hChild, java.lang.String name, java.lang.String type)
createNode
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNode(handle hChild, character name, java.lang.String type)
createNode
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNode(handle hChild, java.lang.String name, character type)
createNode
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNode(handle hChild, character name, character type)
createNode
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success false
otherwise.public logical createNodeNamespace(handle hChild, java.lang.String uri, java.lang.String name, java.lang.String type)
createNodeNamespace
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.uri
- The URI namespace of the node to be created.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNodeNamespace(handle hChild, character uri, java.lang.String name, java.lang.String type)
createNodeNamespace
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.uri
- The URI namespace of the node to be created.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNodeNamespace(handle hChild, java.lang.String uri, character name, java.lang.String type)
createNodeNamespace
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.uri
- The URI namespace of the node to be created.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNodeNamespace(handle hChild, java.lang.String uri, java.lang.String name, character type)
createNodeNamespace
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.uri
- The URI namespace of the node to be created.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNodeNamespace(handle hChild, java.lang.String uri, character name, character type)
createNodeNamespace
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.uri
- The URI namespace of the node to be created.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNodeNamespace(handle hChild, character uri, java.lang.String name, character type)
createNodeNamespace
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.uri
- The URI namespace of the node to be created.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNodeNamespace(handle hChild, character uri, character name, java.lang.String type)
createNodeNamespace
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.uri
- The URI namespace of the node to be created.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical createNodeNamespace(handle hChild, character uri, character name, character type)
createNodeNamespace
in interface XDocument
hChild
- The valid handle class instance of the child to be created and
returned on method call to use further.uri
- The URI namespace of the node to be created.name
- The name of the node to be created.type
- The type of the node to be created.true
in case of success
false
otherwise.public logical getDocumentElement(handle hRoot)
getDocumentElement
in interface XDocument
hRoot
- The valid handle class instance variable to receive the
result.true
in case of success
false
otherwise.public logical load(java.lang.String mode, java.lang.Object source, logical validate)
load
in interface XDocument
mode
- Variable indicating the type of source to read. "file" means
reading from file, "memptr" means reading from memory buffer.source
- If mode == "file" this is the file name, if "memptr" this is
the memptr object.validate
- Flag indicating whether to validate while reading or not.true
in case of success
false
otherwise.public logical load(java.lang.String mode, java.lang.Object source, boolean validate)
load
in interface XDocument
mode
- Variable indicating the type of source to read. "file" means
reading from file, "memptr" means reading from memory buffer.source
- If mode == "file" this is the file name, if "memptr" this is
the memptr object.validate
- Flag indicating whether to validate while reading or not.true
in case of success
false
otherwise.public logical load(character mode, java.lang.Object source, boolean validate)
load
in interface XDocument
mode
- Variable indicating the type of source to read. "file" means reading from file and
source contains file name, "memptr" means reading from memory buffer.source
- If mode == "file" this is the file name, if "memptr" this is the memptr object.validate
- Flag indicating whether to validate while reading or not.true
in case of success false
otherwise. If validate
is true
and xml failed validation return false
but the xml document
is loaded anyway.public logical load(character mode, java.lang.Object source, logical validate)
load
in interface XDocument
mode
- Variable indicating the type of source to read. "file" means reading from file and
source contains file name, "memptr" means reading from memory buffer.source
- If mode == "file" this is the file name, if "memptr" this is the memptr object.validate
- Flag indicating whether to validate while reading or not. If unknown
,
validation will not be done.true
in case of success false
otherwise. If validate
is true
and xml failed validation return false
but the xml document
is loaded anyway.public logical save(java.lang.String mode, java.lang.Object target)
save
in interface XDocument
mode
- Variable indicating the type of target to write. "file" means writing to file,
"stream" means writing to the stream and "memptr" means writing to memory buffer.target
- If mode == "file" this is the file name, if "stream" means output stream, if
"memptr" this is the memptr object.true
in case of success false
otherwise.public logical save(character mode, java.lang.Object target)
save
in interface XDocument
mode
- Variable indicating the type of target to write. "file" means writing to file,
"stream" means writing to the stream and "memptr" means writing to memory buffer.target
- If mode == "file" this is the file name, if "stream" means output stream, if
"memptr" this is the memptr object.true
in case of success false
otherwise.public logical initializeDocumentType(character namespaceUri, character rootNodeName, character publicId, character systemId)
initializeDocumentType
in interface XDocument
namespaceUri
- character expression representing the namespace Uniform Resource Identifier
(URI) you want associated with the root node of the XML document. The
namespace-uri must be unique and persistent.rootNodeName
- A character expression representing the name of the root node as defined in the
XML document. If you are using namespaces and you want to associate a prefix
with the namespace, you must qualify this node name with the namespace-uri
and a colon character prefix (for example, namespace-uri:root-node-name).
You must explicitly set the xmlns attribute on the root node.publicId
- An optional character expression representing the public ID of the DTD.systemId
- A required character expression representing the system ID of the DTD. This
contains the path to the DTD which is either a file system path or an HTTP URL.true
in case of success
false
otherwise.public logical initializeDocumentType(character namespaceUri, java.lang.String rootNodeName, character publicId, character systemId)
initializeDocumentType
in interface XDocument
namespaceUri
- character expression representing the namespace Uniform Resource Identifier
(URI) you want associated with the root node of the XML document. The
namespace-uri must be unique and persistent.rootNodeName
- A character expression representing the name of the root node as defined in the
XML document. If you are using namespaces and you want to associate a prefix
with the namespace, you must qualify this node name with the namespace-uri
and a colon character prefix (for example, namespace-uri:root-node-name).
You must explicitly set the xmlns attribute on the root node.publicId
- An optional character expression representing the public ID of the DTD.systemId
- A required character expression representing the system ID of the DTD. This
contains the path to the DTD which is either a file system path or an HTTP URL.true
in case of success
false
otherwise.public logical initializeDocumentType(java.lang.String namespaceUri, character rootNodeName, java.lang.String publicId, java.lang.String systemId)
initializeDocumentType
in interface XDocument
namespaceUri
- character expression representing the namespace Uniform Resource Identifier
(URI) you want associated with the root node of the XML document. The
namespace-uri must be unique and persistent.rootNodeName
- A character expression representing the name of the root node as defined in the
XML document. If you are using namespaces and you want to associate a prefix
with the namespace, you must qualify this node name with the namespace-uri
and a colon character prefix (for example, namespace-uri:root-node-name).
You must explicitly set the xmlns attribute on the root node.publicId
- An optional character expression representing the public ID of the DTD.systemId
- A required character expression representing the system ID of the DTD. This
contains the path to the DTD which is either a file system path or an HTTP URL.true
in case of success
false
otherwise.public logical initializeDocumentType(java.lang.String namespaceUri, java.lang.String rootNodeName, java.lang.String publicId, java.lang.String systemId)
initializeDocumentType
in interface XDocument
namespaceUri
- character expression representing the namespace Uniform Resource Identifier
(URI) you want associated with the root node of the XML document. The
namespace-uri must be unique and persistent.rootNodeName
- A character expression representing the name of the root node as defined in the
XML document. If you are using namespaces and you want to associate a prefix
with the namespace, you must qualify this node name with the namespace-uri
and a colon character prefix (for example, namespace-uri:root-node-name).
You must explicitly set the xmlns attribute on the root node.publicId
- An optional character expression representing the public ID of the DTD.systemId
- A required character expression representing the system ID of the DTD. This
contains the path to the DTD which is either a file system path or an HTTP URL.true
in case of success
false
otherwise.public character getPublicId()
getPublicId
in interface XDocument
public character getSystemId()
getSystemId
in interface XDocument
public character getSchemaLocation()
getSchemaLocation
in interface XmlSchema
public logical importNode(handle xNodeRef, handle xSourceNodeRef, logical deep)
importNode
in interface XDocument
xNodeRef
- The valid handle class instance to use for the new XML node.xSourceNodeRef
- The valid handle class instance to import from.deep
- A logical that if true
specifies that the whole sub-tree is to be
copied. The default value is false
.true
in case of success false
otherwise.public logical importNode(handle xNodeRef, handle xSourceNodeRef, boolean deep)
importNode
in interface XDocument
xNodeRef
- The valid handle class instance to use for the new XML node.xSourceNodeRef
- The valid handle class instance to import from.deep
- A boolean that if true
specifies that the whole sub-tree is to be
copied. The default value is false
.true
in case of success false
otherwise.public void setSchemaLocation(character schemaLocation)
setSchemaLocation
in interface XmlSchema
schemaLocation
- Determines the list of namespace/location pairs of an XML Schema file to
validate against.public character getEncoding()
getEncoding
in interface Encoding
public character getSchemaPath()
getSchemaPath
in interface XmlSchema
public void setEncoding(java.lang.String encoding)
setEncoding
in interface Encoding
encoding
- The encoding value to be set for the given writer.public void setSchemaPath(character schemaPath)
setSchemaPath
in interface XmlSchema
schemaPath
- To separate directory paths, use a comma, or a delimiter character that your
operating system recognizes.public void setEncoding(character encoding)
setEncoding
in interface Encoding
public character getNonamespaceSchemaLocation()
getNonamespaceSchemaLocation
in interface XCommon
getNonamespaceSchemaLocation
in class XCommonImpl
public void setNonamespaceSchemaLocation(character location)
setNonamespaceSchemaLocation
in interface XCommon
setNonamespaceSchemaLocation
in class XCommonImpl
location
- New value of the nonamespace-schema-location attribute to set.public logical addSchemaLocation(character namespace, character location)
addSchemaLocation
in interface XCommon
addSchemaLocation
in class XCommonImpl
namespace
- Target namespace of the schema or am empty string or Unknown value.location
- Location of the XML schema file.true
in case of success false
otherwise.public integer getChildNum()
getChildNum
in interface XEntity
public logical getSuppressNamespaceProcessing()
getSuppressNamespaceProcessing
in interface XmlSchema
public void setSuppressNamespaceProcessing(logical suppress)
setSuppressNamespaceProcessing
in interface XmlSchema
suppress
- The new value the current suppress-namespace-processing attribute.public void setSuppressNamespaceProcessing(boolean suppress)
setSuppressNamespaceProcessing
in interface XmlSchema
suppress
- The new value the current suppress-namespace-processing attribute.public handle getOwnerDocument()
getOwnerDocument
in interface XEntity
private void invalidReadWriteModeError(java.lang.String attribute)
attribute
- The read-only attribute.