diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getEncoding.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getEncoding.xml new file mode 100644 index 0000000000..cb3311796d --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getEncoding.xml @@ -0,0 +1,137 @@ + + + + + + SDO_DAS_XML_Document::getEncoding + + Returns encoding string. + + + + &reftitle.description; + + stringSDO_DAS_XML_Document::getEncoding + + + + &warn.experimental.func; + + Returns the encoding string for the SDO_DAS_XML_Document object. + + + + &reftitle.parameters; + + + + + + &reftitle.returnvalues; + + Returns the encoding string. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getNoNamespaceSchemaLocation.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getNoNamespaceSchemaLocation.xml new file mode 100644 index 0000000000..3f7ff288c6 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getNoNamespaceSchemaLocation.xml @@ -0,0 +1,136 @@ + + + + + + SDO_DAS_XML_Document::getNoNamespaceSchemaLocation + + Returns no namespace schema location. + + + + &reftitle.description; + + stringSDO_DAS_XML_Document::getNoNamespaceSchemaLocation + + + + &warn.experimental.func; + + Returns the no namespace schema location. + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns no namespace schema location. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRoorDataObject.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRoorDataObject.xml new file mode 100644 index 0000000000..c53ffb58ce --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRoorDataObject.xml @@ -0,0 +1,137 @@ + + + + + + SDO_DAS_XML_Document::getRoorDataObject + + Returns the root SDO_DataObject. + + + + &reftitle.description; + + SDO_DataObjectSDO_DAS_XML_Document::getRoorDataObject + + + + &warn.experimental.func; + + Returns the root SDO_DataObject. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns the root SDO_DataObject. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRootElementName.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRootElementName.xml new file mode 100644 index 0000000000..25e85322a9 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRootElementName.xml @@ -0,0 +1,137 @@ + + + + + + SDO_DAS_XML_Document::getRootElementName + + Returns root element's name. + + + + &reftitle.description; + + stringSDO_DAS_XML_Document::getRootElementName + + + + &warn.experimental.func; + + Returns root element's name. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns root element's name. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRootElementURI.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRootElementURI.xml new file mode 100644 index 0000000000..bc78c7fe70 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getRootElementURI.xml @@ -0,0 +1,137 @@ + + + + + + SDO_DAS_XML_Document::getRootElementURI + + Returns root element's URI string. + + + + &reftitle.description; + + stringSDO_DAS_XML_Document::getRootElementURI + + + + &warn.experimental.func; + + Returns root element's URI string. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns root element's URI string. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getSchemaLocation.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getSchemaLocation.xml new file mode 100644 index 0000000000..bb67c7f325 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getSchemaLocation.xml @@ -0,0 +1,137 @@ + + + + + + SDO_DAS_XML_Document::getSchemaLocation + + Returns schema location. + + + + &reftitle.description; + + stringSDO_DAS_XML_Document::getSchemaLocation + + + + &warn.experimental.func; + + Returns schema location. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns schema location. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getXMLDeclaration.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getXMLDeclaration.xml new file mode 100644 index 0000000000..caed3f0218 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getXMLDeclaration.xml @@ -0,0 +1,137 @@ + + + + + + SDO_DAS_XML_Document::getXMLDeclaration + + Returns whether the xml declaration is set or not. + + + + &reftitle.description; + + booleanSDO_DAS_XML_Document::getXMLDeclaration + + + + &warn.experimental.func; + + Returns whether the xml declaration is set or not. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns whether the xml declaration is set or not. TRUE If it is set and FALSE if it is not. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getXMLVersion.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getXMLVersion.xml new file mode 100644 index 0000000000..1e487d6420 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-getXMLVersion.xml @@ -0,0 +1,137 @@ + + + + + + SDO_DAS_XML_Document::getXMLVersion + + Returns xml declaration string. + + + + &reftitle.description; + + stringSDO_DAS_XML_Document::getXMLVersion + + + + &warn.experimental.func; + + Returns xml declaration string. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + Returns xml declaration string. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setEncoding.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setEncoding.xml new file mode 100644 index 0000000000..9799b0293e --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setEncoding.xml @@ -0,0 +1,147 @@ + + + + + + SDO_DAS_XML_Document::setEncoding + + Sets the given string as encoding. + + + + &reftitle.description; + + voidSDO_DAS_XML_Document::setEncoding + stringencoding + + + &warn.experimental.func; + + Sets the given string as encoding. + + + + + &reftitle.parameters; + + + + encoding + + + Encoding string. + + + + + + + + &reftitle.returnvalues; + + None. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setNoNamespaceSchemaLocation.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setNoNamespaceSchemaLocation.xml new file mode 100644 index 0000000000..77726606a0 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setNoNamespaceSchemaLocation.xml @@ -0,0 +1,147 @@ + + + + + + SDO_DAS_XML_Document::setNoNamespaceSchemaLocation + + Sets the given string as no namespace schema location. + + + + &reftitle.description; + + voidSDO_DAS_XML_Document::setNoNamespaceSchemaLocation + stringnnschemaLocation + + + &warn.experimental.func; + + Sets the given string as no namespace schema location. + + + + + &reftitle.parameters; + + + + nnschemaLocation + + + no namespace schema location. + + + + + + + + &reftitle.returnvalues; + + None. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setSchemaLocation.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setSchemaLocation.xml new file mode 100644 index 0000000000..b69f363d84 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setSchemaLocation.xml @@ -0,0 +1,147 @@ + + + + + + SDO_DAS_XML_Document::setSchemaLocation + + Sets the given string as schema location. + + + + &reftitle.description; + + voidSDO_DAS_XML_Document::setSchemaLocation + stringschemaLocation + + + &warn.experimental.func; + + Sets the given string as schema location. + + + + + &reftitle.parameters; + + + + schemaLocation + + + schema location. + + + + + + + + &reftitle.returnvalues; + + None. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setXMLDeclaration.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setXMLDeclaration.xml new file mode 100644 index 0000000000..3cc70b9e50 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setXMLDeclaration.xml @@ -0,0 +1,147 @@ + + + + + + SDO_DAS_XML_Document::setXMLDeclaration + + Sets the xml declaration. + + + + &reftitle.description; + + voidSDO_DAS_XML_Document::setXMLDeclaration + boolxmlDeclatation + + + &warn.experimental.func; + + Sets the given given boolean value for xml declaration. Pass TRUE to set it and FLASE to not to unset it. + + + + + &reftitle.parameters; + + + + xmlDeclatation + + + boolean value to set the XML declaration. + + + + + + + + &reftitle.returnvalues; + + None. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setXMLVersion.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setXMLVersion.xml new file mode 100644 index 0000000000..630420a084 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-Document-setXMLVersion.xml @@ -0,0 +1,147 @@ + + + + + + SDO_DAS_XML_Document::setXMLVersion + + Sets the given string as xml version. + + + + &reftitle.description; + + voidSDO_DAS_XML_Document::setXMLVersion + stringxmlVersion + + + &warn.experimental.func; + + Sets the given string as xml version. + + + + + &reftitle.parameters; + + + + xmlVersion + + + xml version string. + + + + + + + + &reftitle.returnvalues; + + None. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-create.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-create.xml new file mode 100644 index 0000000000..3cbb29a25c --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-create.xml @@ -0,0 +1,162 @@ + + + + + + SDO_DAS_XML::create + + To create SDO_DAS_XML object for a given schema file. + + + + &reftitle.description; + + SDO_DAS_XMLSDO_DAS_XML::create + stringxsd_file + + + &warn.experimental.func; + + This is the only static method of SDO_DAS_XML class. used to instantiate SDO_DAS_XML object. + + + + + &reftitle.parameters; + + + + xsd_file + + + Path to XSD Schema file. + + + + + + + + &reftitle.returnvalues; + + Returns SDO_DAS_XML object on success otherwise throws an exception as described below. + + + + + &reftitle.exceptions; + + + + SDO_TypeNotFoundException + + + Thrown if a type is not defined in the underlying model. + + + + + SDO_DAS_XML_ParserException + + + Thrown for any symantical problems while parsing the given XSD File. + + + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-createDataObject.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-createDataObject.xml new file mode 100644 index 0000000000..d8f50ed317 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-createDataObject.xml @@ -0,0 +1,162 @@ + + + + + + SDO_DAS_XML::createDataObject + + Creates SDO_DataObject for a given namespace URI and type name. + + + + &reftitle.description; + + SDO_DataObjectSDO_DAS_XML::createDataObject + stringnamespace_uri + stringtype_name + + + &warn.experimental.func; + + Creates SDO_DataObject for a given namespace URI and type name. The type should be defined in the underlying model otherwise SDO_TypeNotFoundException will be thrown. + + + + &reftitle.parameters; + + + + namespace_uri + + + Namespace URI of the type name. + + + + + type_name + + + Type Name. + + + + + + + + &reftitle.returnvalues; + + Returns SDO_DataObject on success. + + + + + &reftitle.exceptions; + + + + SDO_TypeNotFoundException + + + Thrown if a type is not defined in the underlying model. + + + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-loadFromFile.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-loadFromFile.xml new file mode 100644 index 0000000000..267f9821d1 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-loadFromFile.xml @@ -0,0 +1,169 @@ + + + + + + SDO_DAS_XML::loadFromFile + + Returns SDO_DAS_XML_Document object for a given path to xml instance document. + + + + &reftitle.description; + + SDO_XMLDocumentSDO_DAS_XML::loadFromFile + stringxml_file + + + &warn.experimental.func; + + Constructs the tree of SDO_DataObjects' from the given address to xml instance document. Returns SDO_DAS_XML_Document Object. Use SDO_DAS_XML_Document::getRootDataObject method to get root data object. + + + + + &reftitle.parameters; + + + + xml_file + + + Path to Instance document. This can be a path to a local file or it can be a URL. + + + + + + + + &reftitle.returnvalues; + + Returns SDO_DAS_XML_Document object on Success or throws exception as described. + + + + + &reftitle.exceptions; + + + + SDO_TypeNotFoundException + + + Thrown if a type is not defined by the underlying model. + + + + + SDO_PropertyNotFoundException + + + Thrown if the a property within a type is not defined in the underlying model. + + + + + SDO_DAS_XML_ParserException + + + Thrown for any symantical problems while parsing the given XSD File. + + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-loadFromString.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-loadFromString.xml new file mode 100644 index 0000000000..ad681e0781 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-loadFromString.xml @@ -0,0 +1,170 @@ + + + + + + SDO_DAS_XML::loadFromString + + Returns SDO_DAS_XML_Document for a given xml instance string. + + + + &reftitle.description; + + SDO_DAS_XML_DocumentSDO_DAS_XML::loadFromString + stringxml_string + + + &warn.experimental.func; + + Constructs the tree of SDO_DataObjects' from the given xml instance string. Returns SDO_DAS_XML_Document Object. Use SDO_DAS_XML_Document::getRootDataObject method to get root data object. + + + + + &reftitle.parameters; + + + + xml_string + + + xml string. + + + + + + + + &reftitle.returnvalues; + + Returns SDO_DAS_XML_Document object on Success or throws exception as described. + + + + + &reftitle.exceptions; + + + + SDO_TypeNotFoundException + + + Thrown if a type is not defined by the underlying model. + + + + + SDO_PropertyNotFoundException + + + Thrown if the a property within a type is not defined in the underlying model. + + + + + SDO_DAS_XML_ParserException + + + Thrown for any symantical problems while parsing the given XSD File. + + + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDataObjectToFile.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDataObjectToFile.xml new file mode 100644 index 0000000000..5ce5872a53 --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDataObjectToFile.xml @@ -0,0 +1,166 @@ + + + + + + SDO_DAS_XML::saveDataObjectToFile + + Saves the SDO_DataObject object to File. + + + + &reftitle.description; + + voidSDO_DAS_XML::saveDataObjectToFile + SDO_DataObjectdo + stringroot_uri + stringroot_name + stringxml_file + + + &warn.experimental.func; + + Saves the SDO_DataObject object as an XML File. + + + + + &reftitle.parameters; + + + + do + + + DataObject, which needs to be saves as an XML File. + + + + + root_uri + + + URI string for the root DataObject. + + + + + root_name + + + Type name of the root DataObject. + + + + + + + + + &reftitle.returnvalues; + + None. + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDataObjectToString.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDataObjectToString.xml new file mode 100644 index 0000000000..e4bc288b5f --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDataObjectToString.xml @@ -0,0 +1,165 @@ + + + + + + SDO_DAS_XML::saveDataObjectToString + + Saves the SDO_DataObject object to string. + + + + &reftitle.description; + + stringSDO_DAS_XML::saveDataObjectToString + SDO_DataObjectdo + stringroot_uri + stringroot_name + + + &warn.experimental.func; + + Saves the SDO_DataObject object as an XML string. + + + + + &reftitle.parameters; + + + + do + + + DataObject, which needs to be saves as an XML File. + + + + + root_uri + + + URI string for the root DataObject. + + + + + root_name + + + Type name of the root DataObject. + + + + + + + + &reftitle.returnvalues; + + xml string + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDocumentToFile.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDocumentToFile.xml new file mode 100644 index 0000000000..ab3f788f9c --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDocumentToFile.xml @@ -0,0 +1,156 @@ + + + + + + SDO_DAS_XML::saveDocumentToFile + + Saves the SDO_DAS_XML_Document object to a file. + + + + &reftitle.description; + + voidSDO_DAS_XML::saveDocumentToFile + SDO_XMLDocumentxdoc + stringxml_file + + + &warn.experimental.func; + + Saves the SDO_DAS_XML_Document object to a file. + + + + + + &reftitle.parameters; + + + + xdoc + + + SDO_DAS_XML_Document object. + + + + + xml_file + + + xml file. + + + + + + + + &reftitle.returnvalues; + + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDocumentToString.xml b/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDocumentToString.xml new file mode 100644 index 0000000000..ae6a1d385e --- /dev/null +++ b/reference/sdo_das_xml/functions/SDO-DAS-XML-saveDocumentToString.xml @@ -0,0 +1,148 @@ + + + + + + SDO_DAS_XML::saveDocumentToString + + Saves the SDO_DAS_XML_Document object to a string. + + + + &reftitle.description; + + stringSDO_DAS_XML::saveDocumentToString + SDO_XMLDocumentxdoc + + + &warn.experimental.func; + + Saves the SDO_DAS_XML_Document object to string. + + + + + + &reftitle.parameters; + + + + xdoc + + + SDO_DAS_XML_Document object. + + + + + + + + &reftitle.returnvalues; + + xml string. + + + + + + + + + + + + + + + + + + diff --git a/reference/sdo_das_xml/reference.xml b/reference/sdo_das_xml/reference.xml new file mode 100644 index 0000000000..5bc09fbab1 --- /dev/null +++ b/reference/sdo_das_xml/reference.xml @@ -0,0 +1,568 @@ + + + + + SDO XML Data Access Service Functions + XML DAS + + +
+ &reftitle.intro; + + + &warn.experimental; + + + In order to use the XML Data Access Service for Service Data Objects, you will need to understand some of the concepts behind SDO: the data graph, the data object, XPath and property expressions, and so on. + If you are not familiar with these ideas, you might want to look first at + the section on SDO +. + + + + + + The job of the XML DAS is to move data between the application and an XML data source. + In order to do this it needs to be told the XML schema the XML should follow. + This model information is used to ensure conformance of XML being written out, and also to ensure that + modifications made to an SDO originating from XML follow the model described by the XML schema. + + + The XML DAS currently supports reading/writing XML to/from a file or an http URL (for example, to support RSS feeds). + +
+ +
+ &reftitle.required; + + The SDO XML Data Access Service requires PHP 5.1 or higher. It is packaged with the SDO extension and requires SDO to have been installed. + See the + SDO installation instructions +for steps on how to do this. + + +
+ +
+ &reftitle.install; + + The XML Data Access Service is packaged and installed as part of the SDO extension. + There are additional installations steps required. + +
+ +
+ Limitations + + The SDO 2.0 specification defines the mapping between XML types and SDO types. With Java SDO, this mapping is implemented by the XMLHelper. With SDO for PHP, this mapping is implemented by the XML Data Access Services. The XML DAS implements the mapping described in the SDO 2.0 specification with the following restrictions: + + + + XML Simple Types + + +Simple Type with abstract="true" - no PHP support for SDO abstract types. + + + + +Simple Type with sdoJava:instanceClass - no PHP equivalent provided. + + + + +Simple Type with sdoJava:extendedInstanceClass - no PHP equivalent provided. + + + + +Simple Type with list of itemType. + + + + +Simple Type with union. + + + + + + XML Complex Types + + +Complex Type with abstract="true" - no PHP support for SDO abstract types. + + + + +Complex Type with sdo:aliasName - no PHP support for SDO Type aliases. + + + + +Complex Type with open content - no PHP support for SDO open types. + + + + +Complex Type with open attribute - no PHP support for SDO open types. + + + + + + XSD Attribute + + +Attribute with sdo:aliasName - no PHP support for SDO property aliases. + + + + +Attribute with default value - no PHP support for SDO property defaults. + + + + +Attribute with fixed value - no PHP support for SDO read-only properties or default values. + + + + +Attribute reference. + + + + +Attribute with sdo:string - no support for sdo:string="true". + + + + +Attribute referencing a DataObject with sdo:propertyType - no support for sdo:propertyType="...". + + + + +Attribute with bi-directional property to a DataObject with sdo:oppositeProperty and sdo:propertyType - no PHP support for SDO opposite. + + + + + + XSD Elements + + +Element with sdo:aliasName - no PHP support for SDO property aliases. + + + + +Element reference. + + + + +Element with nillable. + + + + +Element with substitution group. + + + + + + XSD Elements with Simple Type + + +Element of SimpleType with default - no PHP support for SDO defaults + + + + +Element of SimpleType with fixed value - - no PHP support for SDO read-only properties or default values. + + + + +Element of SimpleType with sdo:string - no support for sdo:string="true". + + + + +Element referencing a DataObject with sdo:propertyType - no support for sdo:propertyType="..." + + + + +Element with bi-directional reference to a DataObject with sdo:oppositeProperty and sdo:propertyType - no PHP support for SDO opposite. + + + +
+ + +
+ &reftitle.examples; + + The following examples are based on the + letter example +described in the + SDO documentation +. + The examples assume the XML Schema for the letter is contained in a the file + letter.xsd +and the letter instance is in the file + letter.xml +. + + + Working with the SDO_DAS_XML Class + + The following example shows how to create a SDO_DAS_XML Object and use it to load an instance document. + The SDO_XML_DAS object can be created by passing the xsd file to the SDO_DAS_XML::create method, which is a static method of SDO_DAS_XML Class. This schema file(XSD Document) can be either file available on the local file system or it can be an URL. + Once we have created the SDO_XML_DAS Object, we can use the same to load the instance document using loadFromFile method. loadFromString method can be used if want load xml instance document which is available as string. + On successful loading of the instance document, you will be returned with an object of type SDO_DAS_XML_Document. Use the getRootDataObject method of SDO_DAS_XML_Document class to get the root DataObject. + This example also tries to modify the properties of the root DataObject and then write the changed contents back to file system. + + + loadFromFile("letter.xml"); + $do = $xdoc->getRootDataObject(); + $do->date = "September 03, 2004"; + $do->firstName = "Anantoju"; + $do->lastName = "Madhu"; + $xmldas->saveDocumentToFile($xdoc, "letter-out.xml"); +} catch (SDO_TypeNotFoundException $e) { + print("Type is not defined in the xsd file"); +} catch (SDO_DAS_XML_ParserException $e) { + print("Problem while parsing"); +} +?> +]]> + + + + Working with the SDO_DAS_XML Class + + The above example shown, how to use the SDO_XML_DAS object to load an existing instance document and change the DataObject(property values) and write the changes back to file system. + This example shows, how to create the DataObjects dynamically and save them as a xml string. Please note that this example uses a company schema((company.xsd)) as defined in SDO samples section. + + + createDataObject("companyNS", "CompanyType"); +$do->name = "Acme Inc"; +$dept1 = $do->createDataObject("departments"); +$dept1->name = "sales"; +$emp1 = $dept1->createDataObject("employees"); +$emp1->name = "Fred"; +$emp1->manager = FALSE; +$dept2 = $do->createDataObject("departments"); +$emp2 = $dept2->createDataObject("employees"); +$emp2->name = "Neil"; +$emp2->manager = TRUE; +print($xmldas->saveDataObjectToString($do, "companyNS", "CompanyType")); +var_dump($do); +?> + +]]> + + + + + Working with the SDO_DAS_XML Class + + This example shows you how to create the DataObject and use the Sequence API (For more information on Sequence API) to construct a letter containing unstructured text. + + + createDataObject("http://letterSchema", "FormLetter"); + $seq = $do->getSequence(); + $seq->insert("April 09, 2005", NULL, 'date'); + $seq->insert("Acme Inc. ", NULL, NULL); + $seq->insert("United Kingdom. "); + $seq->insert("Dear", NULL, NULL); + $seq->insert("Tarun", NULL, "firstName"); + $seq->insert("Nayaraaa", NULL, "lastName"); + $do->lastName = "Nayar"; + $seq->insert("Please note that your order number "); + $seq->insert(12345); + $seq->insert(" has been dispatched today. Thanks for your business with us."); + $type = $do->getType(); + print($xmldas->saveDataObjectToString($do, $type[0], $type[1])); + } catch (SDO_Exception $e) { + print($e); + } +} catch (SDO_TypeNotFoundException $e) { + print("Type is not defined in the xsd file"); +} catch (SDO_DAS_XML_ParserException $e) { + print("Problem while parsing"); +}?> +]]> + + + + Working with the SDO_DAS_XML_Document Class + + This example shows you how to use the SDO_DAS_XML_Document class. SDO_DAS_XML_Document class is provided to get/set XML declarations such as version, schema location, encoding etc. + + + loadFromFile("letter.xml"); + print("Encoding is set to : " . $xdoc->getEncoding()); + print("XML Version : " . $xdoc->getXMLVersion(); + $xdoc->setXMLVersion("1.1"); + print($xmldas->saveDocumentToString($xdoc)); +} catch (SDO_TypeNotFoundException $e) { + print("Type is not defined in the xsd file"); +} catch (SDO_DAS_XML_ParserException $e) { + print("Problem while parsing"); +} +?> + +]]> + + +
+ + + +
+ &reftitle.classes; + + The XML DAS provides three classes. The SDO_DAS_XML which is the main class used to fetch the data from the XML source and also can used to write the data back. + The next one is SDO_DAS_XML_Document class, which is basically useful to get/set the XML declarations such as encoding, version etc. And the last class is SDO_DAS_XML_ParserException which will be thrown for any parser exceptions while loading xsd/xml file. + + + +
+ + <classname>SDO_DAS_XML</classname> + + + This is the main class of XML DAS, which is used fetch the data from the xml source and also used to write the data back. Other than the methods to load and save xml files, it also has a method called createDataObject which can be used to create an empty DataObject of a given type. + +
&reftitle.methods; + + + + create +This is the only static method available in SDO_DAS_XML class. Used to construct SDO_XML_DAS object. + + + + + createDataObject +Can be used to construct the DataObject of a given type. + + + + + loadFromFile +Loads the xml instance document from a file. This file can be at local file system or it can be on a remote host. + + + + + loadFromString +same as the above method. loads the xml instance which is available as string. + + + + + saveDataObjectToFile +save SDO_DataObject to a file. + + + + + saveDataObjectToString +save SDO_DataObject to as a xml file. + + + + + saveDocumentToFile +save SDO_DAS_XML_Document object as a xml file. + + + + + + saveDocumentToString +save SDO_DAS_XML_Document object as a xml string. + + + + +
+
+ + +
+ + <classname>SDO_DAS_XML_Document</classname> + + + This class can be used to get/set XML Declarations such as encoding, schema location etc. + +
&reftitle.methods; + + + + getEncoding +gets the encoding string. + + + + + getNoNamespaceSchemaLocation +gets the no namespace schema location. + + + + + getRootDataObject +gets the root DataObject. + + + + + getRootElementName +gets the root DataObject's name. + + + + + + getRootElementURI +gets the root DataObject's URI. + + + + + + getSchemaLocation +gets schema location. + + + + + + getXMLDeclaration +gets whether xml declaration is set ot not. + + + + + getXMLVersion +gets the xml version. + + + + + + setEncoding +sets the encoding string with the given value. + + + + + + setNoNamespaceSchemaLocation +sets the no namespace schema location with the given value. + + + + + + setSchemaLocation +sets the schema location with the given value. + + + + + + setXMLDeclaraion +to set/unset the xml declaration. + + + + + + setXMLVersion +sets the xml version with the given value. + + + +
+
+ +
+ + <classname>SDO_DAS_XML_ParserException</classname> + + + Is a subclass of SDO_Exception + Thrown, for any parser errors while loading the xsd/xml file. + +
+
+ +
+ &reference.sdo-das-xml.functions; +
+ +