|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Article Discussion: Serializing XML With PHP
Simplify the task of creating XML documents with the XML_Serializer class, which lets you build nested XML documents from PHP data structures like arrays and objects (and vice versa). I'll show you how to build an XML document tree via the XML_Serializer class from PEAR, how to programmatically create an XML document from an array or an object, how to attach attributes to elements, and how to customize the behavior of the serializer. All this, and much, much more!
Read the full article here: Serializing XML With PHP |
|
#2
|
|||
|
|||
|
Hi, this is my first post in this forum.
I'm italian I'm sorry for my english. I have read this important article, I have installed PHP pear on my Local Apache server and it's working fine. I have manually installed the xml_serializer package in my PEAR directory (because the web installer doesn't install the package that aren't "stable"). I have try to make some example but I have an error : Code:
Notice: Array to string conversion in C:\Programmi\Apache Group\Apache2\htdocs\xml\xml_serializer\XML_Serializer-0.9.1\Serializer.php on line 492 I have try to put this code in the serialize Class Code:
error_reporting(E_ALL & ~E_NOTICE); The error doesn't occur but the result is incorrect I haven't the result like a tutorials. Can you help me to resolve this error ? |
|
#4
|
|||
|
|||
|
I thought it was a great start to dynamically building an XML document. I was wondering if someone who has used this a bit could explain how I might use
Quote:
for only a part of the XML document for example: Code:
<DOCUMENT PAGE="a4" TYPE="landscape" LEFT="40" RIGHT="20" TOP="10" BOTTOM="30">
<DATASOURCE>
<FIELDS>"id_clinic, gpms_clinic, legal_name_clinic"</FIELDS>
<TABLE>"clinic_clinic INNER JOIN AR_aging ON id_clinic=idclinic_aging"</TABLE>
<WHERE>"active_clinic=1 AND id_clinic='".vars("idclinic")."'"</WHERE>
<GROUPBY>"gpms_clinic"</GROUPBY>
<ORDERBY>""</ORDERBY>
</DATASOURCE>
<PAGEHEADER HEIGHT="0">
<LINE X1="0" Y1="38" X2="770" Y2="+0" COLOR="00000" WIDTH="1.5" TYPE="1"/>
<IMAGE X="5" Y="00" WIDTH="215" HEIGHT="35" SRC="LogoPDF.jpg" TYPE="jpeg"/>
</PAGEHEADER>
The DOCUMENT tag is make of scalarAsAttributes, but the following DATASOURCE tags are regular formation? How would I define cartain parts within other parts or after other parts? IE how would I create the above code with XML_Serializer? Thanks for your help. Ezra |
|
#5
|
|||
|
|||
|
I'm more confitable with Serializing XML using Java package from Sun.
__________________
Wedding Gifts | Web Development | Order Fulfllment | Supply Chain | E-Business | Add to 100 SEO Friendly Directories fast do it yourself |
|
#6
|
|||
|
|||
|
XML from MySQL
I've recieved the same error as mentioned previously.
Code:
PHP Notice: Array to string conversion in name/pear/lib/XML/Serializer.php on line 496 I checked the Serializer php at that line and found this: PHP Code:
it seems to check for an empty string element before creating a node of it. Is there a fix for this? My second issue is which writing out the file. Is that code correct in the example to write out the file? Both print the same error. He hadn't done anything with the $result var in any of the fopen() commands, so I'm unsure if the result was actually posted to a file. just curious on that last one.... ![]() |
![]() |
| Viewing: Dev Shed Forums > Other > Development Articles > Article Discussion: Serializing XML With PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|