Home | About SQeeL | Document | DownLoad | Mail Japanese
Home > Document > SQeeL Reference

XML operation function

  • Built-in function
  • xmlNewDocument()
    Description
    Creates new empty XML document
    Creates a tree of objects from an XML document from scratch
    Syntax
    ret = xmlNewDocument()
    Return Value
    document ID:Success
    Requirements
    xmllib.slb
    Example
    Topへ
    xmlLoadDocument()
    Description
    Creates a tree of objects from an XML document by loading the XML file
    You can specify an URL, instead of the file name
    Syntax
    ret = xmlLoadDocument(filename)
    Parameters
    filename:File name
    Return Value
    document ID:Success
    Requirements
    xmllib.slb
    Example
    Topへ
    xmlParseDocument()
    Description
    Parses the argument as XML data and creates a tree of objects from it
    Syntax
    ret = xmlParseDocument(string)
    Parameters
    string:XML-format character string
    Return Value
    document ID:Success
    Requirements
    xmllib.slb
    Example
    Topへ
    xmlFreeDocument()
    Description
    Frees the memory occupied by the XML documents and all related nodes
    This function needs to be called to free the memory occupied by all XML documents
    Syntax
    ret = xmlFreeDocument(document_id)
    Parameters
    document_id:document ID
    Return Value
    0:
    0 or more:Fail
    Requirements
    xmllib.slb
    Example
    Topへ
    xmlSaveDocument()
    Description
    Saves the XML document to a file
    The third argument is the character encoding of the file you save
    When the forth argument is set to TRUE, it formats the content of the file with indent
    Syntax
    ret = xmlSaveDocument(document_id,filename,string,format_flag)
    Parameters
    document_id:document ID
    filename:file name
    string:character code
    format_flag:Format
    Default: FALSE
    Return Value
    saved string:Success
    negative value:Fail
    Requirements
    xmllib.slb
    Example
    Topへ
    xmlDumpDocument()
    Description
    Transfer the XML document to the character string
    When the second argument is set to TRUE, it formats the content of the file
    However, it does not indent like xmlSaveDocument
    URL can be specified instead of the file name
    However, to use this function, PUT must be available in the WEB server
    Syntax
    ret = xmlDumpDocument(document_id,format_flag)
    Parameters
    document_id:document ID
    format_flag:Format
    Return Value
    XML string:Success
    Requirements
    xmllib.slb
    Example
    Topへ
    xmlGetNodeName()
    Description
    ーsQ
    Syntax
    ret = xmlGetNodeName(node_id)
    Parameters
    node_id:Node ID
    Return Value
    string:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetNodeValue()
    Description
    sQ
    Syntax
    ret = xmlGetNodeValue(node_id)
    Parameters
    node_id:Node ID
    Return Value
    string:Success
    Requirements
    xmllib.slb
    Topへ
    xmlSetNodeValue()
    Description
    Sets the value of node. This is used for TEXT, CDATASection, ProcessingInstruction, and COMMENT.
    Syntax
    ret = xmlSetNodeValue(node_id,string)
    Parameters
    node_id:Node ID
    string:character string
    Return Value
    0:Success
    -1:Fail
    Requirements
    xmllib.slb
    Topへ
    xmlGetContent()
    Description
    Gets contents of all nodes under Text and EntityReference node
    Syntax
    ret = xmlGetContent(node_id)
    Parameters
    node_id:Node ID
    Return Value
    string:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetNodeType()
    Description
    Gets the type of nodes
    Syntax
    ret = xmlGetNodeType(node_id)
    Parameters
    node_id:Node ID
    Return Value
    system constant:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetParentNode()
    Description
    Gets the Parent node
    Syntax
    ret = xmlGetParentNode(node_id)
    Parameters
    node_id:Node ID
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetChildNodes()
    Description
    Gets all children nodes
    Syntax
    ret = xmlGetChildNodes(node_id)
    Parameters
    node_id:Node ID
    Return Value
    node ID array:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetFirstChild()
    Description
    Returns a reference to the first object.
    Syntax
    ret = xmlGetFirstChild(node_id)
    Parameters
    node_id:Node ID
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetLastChild()
    Description
    Returns a reference to the last object.
    Syntax
    ret = xmlGetLastChild(node_id)
    Parameters
    node_id:Node ID
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetNextSibling()
    Description
    Gets the next Sibling node
    Syntax
    ret = xmlGetNextSibling(node_id)
    Parameters
    node_id:Node ID
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetPreviousSibling()
    Description
    Gets the previous Sibling node
    Syntax
    ret = xmlGetPreviousSibling(node_id)
    Parameters
    node_id:Node ID
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetOwnerDocument()
    Description
    Gets the document of the node of the argument
    Syntax
    ret = xmlGetOwnerDocument(node_id)
    Parameters
    node_id:Node ID
    Return Value
    document ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlReplaceChild()
    Description
    Replace the old child node with the new child node
    Syntax
    ret = xmlReplaceChild(node_id1,node_id2,node_id3)
    Parameters
    node_id1:Parent node
    node_id2:new child node
    node_id3:old child node
    Return Value
    replaced node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlRemoveChild()
    Description
    Removes the child node from the Parent node
    Syntax
    ret = xmlRemoveChild(node_id1,node_id2)
    Parameters
    node_id1:Parent node
    node_id2:child node
    Return Value
    deleted node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlAppendChild()
    Description
    Adds the Chlid node under the Parent node
    However, If the child node is DocumentFragment, the chlid node of DocumentFragment is added
    Syntax
    ret = xmlAppendChild(node_id1,node_id2)
    Parameters
    node_id1:Parent node
    node_id2:child node
    Return Value
    added node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlHasChildNodes()
    Description
    Validates whether or not the child node exists
    Syntax
    ret = xmlHasChildNodes(node_id)
    Parameters
    node_id:Node ID
    Return Value
    TRUE:Child node exists
    FALSE:Child node does not exist
    Requirements
    xmllib.slb
    Topへ
    xmlCloneNode()
    Description
    Copies node
    If the second argument is set to the TRUE, this function copies the all nodes including children nodes. If it is set to the FALSE, the target node is only copied.
    Note that Attribute is the child node of the Element node.
    Syntax
    ret = xmlCloneNode(node_id,flag)
    Parameters
    node_id:Node ID
    flag:Boolean value
    Return Value
    copied node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetDocumentElement()
    Description
    Gets the Root element node
    To get the Root element, this function is easier to use than the xmlGetFirstChild.
    Syntax
    ret = xmlGetDocumentElement(document_id)
    Parameters
    document_id:Document ID
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlCreateElement()
    Description
    Creates a Element node specified the name
    Syntax
    ret = xmlCreateElement(document_id,emelent_name)
    Parameters
    document_id:Document ID
    emelent_name:Element name
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlCreateDocumentFragment()
    Description
    Creates a DocumentFragment node
    A DocumentFragment node uses to keep
    If DocumentFragment is passed to the second argument of xmlAppendChild, child node of DocumentFragment is added, not DocumentFragment itself.
    Syntax
    ret = xmlCreateDocumentFragment(document_id)
    Parameters
    document_id:Document ID
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlCreateTextNode()
    Description
    Creates a Text node with the specified content
    You do not need to describe <, >, and & as <, >, &.
    & is automatically added at output process.
    Syntax
    ret = xmlCreateTextNode(document_id,string)
    Parameters
    document_id:Document ID
    string:text content
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlCreateComment()
    Description
    Creates a Comment node with specified content
    Syntax
    ret = xmlCreateComment(document_id,string)
    Parameters
    document_id:Document ID
    string:Text content
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlCreateCDATASection()
    Description
    Creates a DATASection node with specified content
    You do not need to describe <, >, and & as <, >, &.
    Syntax
    ret = xmlCreateCDATASection(document_id,string)
    Parameters
    document_id:Document ID
    string:CDATASection content
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlCreateProcessingInstruction()
    Description
    Creates a ProcessingInstruction node with specified target name and data
    Syntax
    ret = xmlCreateProcessingInstruction(document_id,string,string)
    Parameters
    document_id:Document ID
    string:Target name
    string:Data
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlCreateEntityReference()
    Description
    Creates a EntityReference node to refer specified entity
    Syntax
    ret = xmlCreateEntityReference(document_id,string)
    Parameters
    document_id:Document ID
    string:Reference entity name
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetElementsByTagName()
    Description
    Returns a list of all descendant elements that match the specified tag name.
    Syntax
    ret = xmlGetElementsByTagName(document_id,string)
    Parameters
    document_id:Document ID or Element ID
    string:Tag name
    Return Value
    node ID array:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetElementByID()
    Description
    Returns a list of all descendant elements that match the specified ID.
    Syntax
    ret = xmlGetElementByID(document_id,string)
    Parameters
    document_id:Document ID or Element ID
    string:ID name
    Return Value
    node ID:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetTagName()
    Description
    Returns the tag name.
    If the argument is Element, the tag name will be same as xmlGetNodeName. If the argument is other than Element, the tag name will appear blank.
    Syntax
    ret = xmlGetTagName(element_id)
    Parameters
    element_id:Element ID
    Return Value
    string:Success
    Requirements
    xmllib.slb
    Topへ
    xmlGetAttribute()
    Description
    Returns the value of the named attribute.
    Syntax
    ret = xmlGetAttribute(document_id,string)
    Parameters
    document_id:Element ID
    string:attribute name
    Return Value
    string:Success
    Requirements
    xmllib.slb
    Topへ
    xmlSetAttribute()
    Description
    Sets the value of the attribute specifying the name and the value.
    Syntax
    ret = xmlSetAttribute(document_id,string,string)
    Parameters
    document_id:Element ID
    string:attribute name
    string:Attribute value
    Requirements
    xmllib.slb
    Topへ
    xmlRemoveAttribute()
    Description
    Deletes the value of the attribute specifying the name.
    Syntax
    ret = xmlRemoveAttribute(document_id,string)
    Parameters
    document_id:Element ID
    string:attribute name
    Requirements
    xmllib.slb
    Topへ
    xmlXPath()
    Description
    Evaluates XPath of the specified node.
    Syntax
    ret = xmlXPath(document_id,string)
    Parameters
    document_id:Node ID
    string:Xpath character string
    Return Value
    node ID array, string, numeric value, authentic value:Success
    Requirements
    xmllib.slb
    Topへ
    xmlTruncateBlanks()
    Description
    Deletes a node consisting of blank and line feed only.
    If brother node contains either Text node or CDATASection node, the corresponding node will not be deleted.
    DTD consistency check is not required for deleting the node.
    If xmlTruncateBlanks is executed to XML document that is already analyzed, blank space may be deleted.
    Syntax
    ret = xmlTruncateBlanks(node_id)
    Parameters
    node_id:Node ID
    Requirements
    xmllib.slb
    Topへ
    xmlCreateInternalDtd()
    Description
    Creates internal DTD.
    Internal DTD is required for executing xmlDtdSetEntity().
    If the internal DTD already exists, it returns an error.
    Syntax
    ret = xmlCreateInternalDtd(node_id,node_id,node_id,node_id)
    Parameters
    node_id:Document ID
    node_id:Root element name
    node_id:Public ID
    node_id:System ID
    Return Value
    0:Success
    1:Fail because internal DTD already exists.
    negative value:Error
    Requirements
    xmllib.slb
    Topへ
    xmlDtdSetEntity()
    Description
    Sets internal DTD.
    Internal DTD is required before executing this function.
    If the same entity already exists, it always fails to execute the function.
    Syntax
    ret = xmlDtdSetEntity(node_id,node_id,node_id)
    Parameters
    node_id:Document ID
    node_id:Entity name
    node_id:Entity value
    Return Value
    0:Success
    1:Fail because the same entity alreasy exists.
    2:Fail because internal DTD is not defined
    negative value:Error
    Requirements
    xmllib.slb
    Topへ
    xmlDtdSetExternalEntity()
    Description
    Sets external entity.
    If the same entity alreasy exists, it always fails to execute the fucntion.
    Syntax
    ret = xmlDtdSetExternalEntity(node_id,node_id,node_id,node_id)
    Parameters
    node_id:Document ID
    node_id:Entity name
    node_id:Public ID
    node_id:System ID
    Return Value
    0:Success
    1:Fail because the same entity alreasy exists.
    negative value:Error
    Requirements
    xmllib.slb
    Topへ
    xmlDtdGetEntityValue()
    Description
    Gets the entity value based on the entity name.
    This function is effective for internal entity only.
    It returns a blank for external entity.
    Syntax
    ret = xmlDtdGetEntityValue(node_id,node_id)
    Parameters
    node_id:Document ID
    node_id:Entity name
    Return Value
    entity value(string):Success
    Requirements
    xmllib.slb
    Topへ
    xmlDtdGetSystemId()
    Description
    Gets system ID of the external entity.
    Syntax
    ret = xmlDtdGetSystemId(node_id,node_id)
    Parameters
    node_id:Document ID
    node_id:Entity name
    Return Value
    system ID(string):Success
    Requirements
    xmllib.slb
    Topへ
    xmlDtdGetPublicId()
    Description
    Gets public ID of the external entity.
    Syntax
    ret = xmlDtdGetPublicId(node_id,node_id)
    Parameters
    node_id:Document ID
    node_id:Entity name
    Return Value
    public ID(string):Success
    Requirements
    xmllib.slb
    Topへ
    xmlDtdGetEntityNames()
    Description
    Gets the list of entity names.
    Syntax
    ret = xmlDtdGetEntityNames(node_id)
    Parameters
    node_id:Document ID
    Return Value
    entity name array:Success
    Requirements
    xmllib.slb
    Topへ

    © Insight Technology, Inc. 1996-2003 All Rights Reserved.