I don't know why I missed this post. My bad. In case you are still wondering, I can't duplicate the behavior. My output is:
<?xml version="1.0" encoding="UTF-8" ?>
<A1>
<B1>Red</B1>
<B2>Blue</B2>
</A1>
Make sure you are using the latest version of the package. If problem persists, please report your OS, PHP version, ActiveLink PHP XML Package version, and anything else that you think may help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm tested ActivLink:
Input:
<?php
require_once("classes/include.php");
import("org.active-link.xml.XML");
import("org.active-link.xml.XMLDocument");
$myXML = new XML("A1");
$myXML->setTagContent("Red","A1/B1");
$myXML->setTagContent("Blue","A2/B2");
$myXMLDoc = new XMLDocument();
$myXMLDoc->setXML($myXML);
$myXMLDoc->save("example.xml");
?>
Output:
<?xml version="1.0" encoding="UTF-8" ?>
<A1>
<B1>Red</B1>
</A1>
Where is problem? Thank you.
Input:
<?php
require_once("classes/include.php");
import_("org.active-link.xml.XML");
import_("org.active-link.xml.XMLDocument");
$myXML = new XML("A1");
$myXML->setTagContent("Red","A1/B1");
$myXML->setTagContent("Blue","A1/B2");
$myXMLDoc = new XMLDocument();
$myXMLDoc->setXML($myXML);
$myXMLDoc->save("example.xml");
?>
Output:
<?xml version="1.0" encoding="UTF-8" ?>
<A1>
<B1>Red</B1>
</A1>
I don't know why I missed this post. My bad. In case you are still wondering, I can't duplicate the behavior. My output is:
<?xml version="1.0" encoding="UTF-8" ?>
<A1>
<B1>Red</B1>
<B2>Blue</B2>
</A1>
Make sure you are using the latest version of the package. If problem persists, please report your OS, PHP version, ActiveLink PHP XML Package version, and anything else that you think may help.