Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

NewDocument Syntax 2 – PB Docs 2019 – PowerBuilder Library

NewDocument Syntax 2 – PB Docs 2019

NewDocument Syntax 2

Description

Creates a new XML DOM document from scratch.

Syntax

Argument

Description

pbdom_document_name

The name of a PBDOM_DOCUMENT
object.

strRootElementNamespacePrefix

The namespace prefix of the root element to be
contained in the DOM document. This can be an empty
string.

strRootElementNamespaceURI

The namespace URI of the root element to be
contained in the DOM document. This can be an empty
string.

strRootElementName

The name of the root element to be contained in
the DOM document.

strDocTypePublicId

The external subset public
identifier.

strDocTypeSystemId

The external subset system
identifier.

Return value

Boolean.

Returns true if a new document is successfully created, and
false otherwise.

Throws

EXCEPTION_INVALID_ARGUMENT — One of the input strings is
invalid. This can happen if the string has been set to null using the
PowerScript SetNull method.

EXCEPTION_MEMORY_ALLOCATION_FAILURE — Insufficient memory was
encountered while executing this method.

EXCEPTION_INVALID_NAME — The root element name, or the root
element namespace prefix or URI, is invalid.

EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE — This PBDOM_DOCUMENT
object’s internal implementation is NULL. The occurrence of this
exception is rare but can take place if severe memory corruption
occurs.

Examples

  1. This example attempts to create a PBDOM_DOCUMENT object in
    which the root element belongs to no namespace, as indicated by
    the empty strings for the namespace prefix and URI arguments to
    NewDocument:

    When serialized, the XML document looks like the
    following:

    The namespace declaration attribute (xmlns=””) present in
    the root element indicates that the root element belongs to no
    namespace.

  2. This example attempts to create a PBDOM_DOCUMENT object in
    which the root element belongs to a default namespace. The URI is
    http://www.pre.com, which means that the root element belongs to
    the namespace http://www.pre.com. The prefix is an empty string,
    which means that the root element belongs to the
    http://www.pre.com namespace by default:

    When serialized, the XML document looks like the
    following:

    The namespace declaration attribute
    (xmlns=”http://www.pre.com”) present in the root element indicates
    that the root element belongs to the default namespace
    http://www.pre.com. All child elements of root belong to this same
    namespace unless another in-scope namespace declaration is present
    and is used.

  3. This example attempts to create a PBDOM_DOCUMENT object in
    which the root element belong to a prefixed namespace. The
    namespace prefix is pre and the URI is http://www.pre.com. This
    means that the root element will belong to the namespace
    http://www.pre.com, and that the root element will have a
    namespace prefix of pre:

    When serialized, the XML document looks like the
    following:

    A namespace declaration attribute
    (xmlns:pre=”http://www.pre.com”) is present in the root element.
    The root element also contains a pre prefix. This indicates that
    the root element belongs to the namespace
    http://www.pre.com.

    However, the fact that the http://www.pre.com namespace is
    prefixed by pre indicates that the child elements of root belong
    to this same namespace only if their qualified names also contain
    the pre prefix and there is an in-scope namespace declaration for
    http://www.pre.com that is prefixed by pre.

Usage

Using the five parameters available with this syntax provides
more control over the DOCTYPE definition of the document.

See also

SaveDocument


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x